feat: Add C ABI for embedded seekdb (multi‑language SDKs)#135
feat: Add C ABI for embedded seekdb (multi‑language SDKs)#135dengfuping wants to merge 64 commits intooceanbase:masterfrom
Conversation
SeekDB C ABI vs MySQL 5.7 C API Complete ComparisonDocument Information
Alignment Status Overview
Core Function Alignment: 100% ✅ (Parameterized queries, column name retrieval, error handling, character set, transactions) Notes:
Complete MySQL C API Function List (in official documentation order)Basic Functions
Connection Management
Query Execution
Result Set Operations
Error Handling
Character Set
Transactions
Information Queries
Utility Functions
Database Management (Deprecated or Replaceable by SQL)
Prepared Statement API (Parameterized Queries)Core API
Enhanced API
Alignment: 25/26 = 96% ✅ Thread API (Not needed in embedded mode)
Plugin API (Not needed in embedded mode)
SeekDB Extended API (Additional convenience functions)
Data Structure AlignmentSeekdbBind ↔ MYSQL_BIND (100% aligned)
SeekdbField ↔ MYSQL_FIELD (100% aligned)
SeekdbFieldType ↔ enum_field_types (100% aligned)All field type enumeration values are fully aligned. Alignment SummaryCore Function Alignment: 100% ✅The following core functions are fully aligned:
Overall Alignment: ~64%Considering that SeekDB is an embedded database, many functions in MySQL C API related to network connections, server management, and plugins are not applicable:
Practical Usable Alignment: ~96%If only considering functions actually needed in embedded database scenarios:
Implemented Medium Priority APIs: 4 ✅ (2026-01-27)
Unimplemented API Evaluation and RecommendationsEvaluation Principles
Priority Classification🔴 High Priority (Recommended to implement)None 🟡 Medium Priority (Recommended to implement)
🟢 Low Priority (Optional implementation)
⚪ Not Needed
Implementation Recommendations
Key Unimplemented API Notes
Usage Recommendations1. Code MigrationMigrating from MySQL C API to SeekDB C API:
2. Function Mapping
3. Best Practices
ConclusionSeekDB C ABI is fully aligned (100%) with MySQL 5.7 C API in core functions, and achieves high alignment (~96%) in practically usable functions. This makes SeekDB a viable embedded alternative to MySQL C API, providing the same development experience while supporting embedded database mode. Current Status Summary
Unimplemented FunctionsNot Needed (~40 APIs):
Optional Implementation (Low priority, 3 APIs):
These functions do not affect basic database operations, parameterized queries, and column name retrieval. All 4 medium priority APIs have been implemented, improving Prepared Statement completeness and connection management capabilities. |
9263830 to
0a07b97
Compare
9077a16 to
62d3ef8
Compare
…st scripts for darwin
…. [1.1, 2.2, 3.3])
…dout to log file before set_file_name
…ix MTL_SWITCH namespace; remove §7/doc refs - C ABI: row_nulls for NULL vs empty; read_lob_data for TEXT/JSON LOB; MTL_SWITCH(OB_SYS_TENANT_ID) for ObLobManager; namespace share alias for MTL_SWITCH - test: 100KB LONGTEXT via SET SESSION ob_default_lob_inrow_threshold=262144, no table option; special chars metadata test; remove §7 and c-abi-modification-reference references from comments and error messages
- Add LOB read paths for TEXT/JSON columns in result row serialization
- Use print_sql_literal for ObJsonType cells and expand buffer to 32KB
- Add col_is_metadata heuristic: write "{}" for empty metadata in fallback paths
- Add unit tests: very long document (100KB), special chars in metadata, empty JSON metadata
…mpat, install GTest on macOS
… OB_CCACHE in workflow
62d3ef8 to
d4223c6
Compare
- macOS: put ccache in deps devtools/bin so Env.cmake finds it without code change - Linux: install base deps (incl. wget) first so dep_create.sh can download RPMs - Linux: try EPEL+ccache; use OB_USE_CCACHE=OFF when ccache not available in container
…o feat/embedded-mode
…est_seekdb_absolute, remove in-process close+open test
…o feat/embedded-mode
…o feat/embedded-mode
…ibc-header-start.h error
…II redirect before CALL_WITH_NEW_STACK
…o feat/embedded-mode
…le change Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…Range> for macOS arm64 link
dfe593e to
af84c4b
Compare
…SEGV handler in seekdb_close
…, and cert import script
…anches and upload S3 only on main/master/develop/integration/*.*.x
…named-value 'env'
f2ca5a8 to
4edd75e
Compare
Task Description
Solution Description
src/include/)Test Directory (
unittest/include/)Passed Regressions
Build and test:
Upgrade Compatibility
Other Information
Release Note