虚谷数据库 C 语言驱动开发

Develop C drivers for XuguDB using NCI, OCI, and XGCI interfaces.

4|4|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/kourou25/xugudb-dev-skills --skill c-kourou25
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: 虚谷数据库 C 语言驱动开发
Source: https://github.com/kourou25/xugudb-dev-skills/tree/main/skills/xugudb-c
Command: npx skills add https://github.com/kourou25/xugudb-dev-skills --skill c-kourou25

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

帮助 C/C++ 开发者快速实现与虚谷数据库的高性能连接与操作,降低从 Oracle OCI 迁移或新项目引入数据库驱动的复杂度,避免常见的句柄管理、参数绑定和资源泄露错误。

Core Features & Use Cases

  • 多接口支持:覆盖 NCI(原生)、OCI(Oracle 兼容)和 XGCI(简化)三种 C 接口,便于迁移与新开发。
  • 完整流程模板:提供环境与句柄初始化、连接/登录、SQL 预编译与执行、按名/按位绑定、定义输出列、遍历结果、事务控制与资源释放的示例与说明。
  • 迁移与兼容指导:说明 OCI 与 NCI 的前缀差异、连接串格式差异以及建议的迁移步骤与注意事项。
  • 适用场景示例:将现有 Oracle C 应用迁移到虚谷、为高并发 C++ 服务实现低延迟数据访问、或为嵌入式系统集成轻量数据库访问层。

Quick Start

Ask the skill to generate a minimal NCI or XGCI C example that connects to 127.0.0.1:5138/SYSTEM, executes SELECT id, name FROM test, and prints the results.

Frequently Asked Questions about 虚谷数据库 C 语言驱动开发

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to a XuguDB database using a C application?

To connect to XuguDB using C, initialize environment and connection handles via NCI, OCI, or XGCI interfaces, then format the connection string to login and execute SQL statements. The skill provides complete templates for this workflow.

What is the best way to migrate an Oracle OCI C application to XuguDB?

Migrating Oracle OCI applications to XuguDB involves mapping OCI prefixes to NCI equivalents and adjusting connection string formats. The skill outlines specific OCI-compatible migration patterns and highlights prefix differences to ensure smooth transitions.

Can I use parameter binding and result definition with XuguDB C drivers?

Yes, XuguDB C drivers support parameter binding by name or position and output column definition for result sets. The skill provides examples for preparing SQL statements, binding parameters, and fetching results safely.

How do I manage handle lifecycles and avoid resource leaks in XuguDB C programs?

Managing handle lifecycles in XuguDB C programs requires proper initialization and explicit release of environment, connection, and statement handles. The skill details resource management techniques to prevent common memory leaks.

Does XuguDB support lightweight database access layers for embedded C++ systems?

Yes, XuguDB supports lightweight database access layers suitable for embedded C++ systems via the simplified XGCI interface. The skill demonstrates how to integrate basic connection, execution, and transaction control functionalities.

Why are my XuguDB NCI connection strings failing to parse during C driver initialization?

NCI connection strings in XuguDB fail when the format does not match the required standard, such as missing port or schema details. The skill clarifies the exact connection string formats needed for successful login.