jaredzhou/mturso/ffi does not have a README file

    Conn

    pub type Conn

    不透明的连接句柄(背后是外部对象)。
    pub type Db

    不透明的数据库句柄(背后是外部对象)。

    Stmt

    pub type Stmt

    不透明的语句句柄。

    SyncChanges

    pub type SyncChanges

    Opaque fetched sync changes handle.

    SyncDb

    pub type SyncDb

    Opaque sync database handle.

    SyncIo

    pub type SyncIo

    Opaque sync I/O queue item handle.

    SyncOp

    pub type SyncOp

    Opaque sync operation handle.

    SyncStats

    pub type SyncStats

    Opaque sync stats snapshot.

    conn_close

    fn conn_close(conn : Conn) -> Unit

    显式关闭连接(幂等)。

    conn_exec

    fn conn_exec(conn : Conn, sql : Bytes) -> Int64

    执行 INSERT/UPDATE/DELETE/DDL,返回受影响行数;失败返回 -1。

    conn_get_autocommit

    fn conn_get_autocommit(conn : Conn) -> Int

    Whether the connection is currently in autocommit mode.

    conn_last_insert_rowid

    fn conn_last_insert_rowid(conn : Conn) -> Int64

    最近一次 INSERT 的 rowid。

    conn_prepare

    fn conn_prepare(conn : Conn, sql : Bytes) -> Stmt

    conn_prepare_first

    fn conn_prepare_first(conn : Conn, sql : Bytes) -> Stmt

    prepare_first:拿第一条语句;尾巴偏移存进 stmt(stmt_tail 读)。

    conn_resume_sync_io

    fn conn_resume_sync_io(conn : Conn) -> Unit

    conn_wait_job

    fn conn_wait_job(conn : Conn) -> Unit

    等本连接当前 job 结束(close() 释放语句前调用)。

    db_close

    fn db_close(db : Db) -> Unit

    显式关闭数据库(幂等;不调用也会由 finalizer 释放)。

    db_connect

    fn db_connect(db : Db) -> Conn

    从数据库开一个连接。可重复调用,每个连接有独立的事务/语句状态。

    db_open

    fn db_open(path : Bytes) -> Db

    打开数据库。path 为 :memory: 或文件路径。

    last_error

    fn last_error() -> Bytes

    最近一次错误信息(无错误时为空串)。

    last_error_kind

    fn last_error_kind() -> Int

    最近一次错误的分类(0 = 无错误;1 = Query,2 = Busy,3 = Conflict, 4 = Connection)。消息仍是文本,分类给上层做模式匹配。

    stmt_bind_blob

    fn stmt_bind_blob(stmt : Stmt, pos : Int, value : Bytes) -> Unit

    stmt_bind_double

    fn stmt_bind_double(stmt : Stmt, pos : Int, value : Double) -> Unit

    stmt_bind_int

    fn stmt_bind_int(stmt : Stmt, pos : Int, value : Int64) -> Unit

    stmt_bind_null

    fn stmt_bind_null(stmt : Stmt, pos : Int) -> Unit

    stmt_bind_text

    fn stmt_bind_text(stmt : Stmt, pos : Int, value : Bytes) -> Unit

    stmt_column_count

    fn stmt_column_count(stmt : Stmt) -> Int

    stmt_deinit

    fn stmt_deinit(stmt : Stmt) -> Unit

    stmt_tail

    fn stmt_tail(stmt : Stmt) -> Int64

    submit_stmt_execute

    fn submit_stmt_execute(conn : Conn, stmt : Stmt) -> Int

    Execute one prepared statement on the connection worker.

    submit_stmt_rows

    fn submit_stmt_rows(conn : Conn, stmt : Stmt) -> Int

    流式跑一条已经 prepare + bind 好的语句;返回读端 fd/HANDLE,失败通过 last_error 报告。

    sync_changes_close

    fn sync_changes_close(changes : SyncChanges) -> Unit

    sync_changes_is_null

    fn sync_changes_is_null(changes : SyncChanges) -> Bool

    sync_db_apply_changes

    fn sync_db_apply_changes(db : SyncDb, changes : SyncChanges) -> SyncOp

    sync_db_checkpoint

    fn sync_db_checkpoint(db : SyncDb) -> SyncOp

    sync_db_close

    fn sync_db_close(db : SyncDb) -> Unit

    sync_db_connect

    fn sync_db_connect(db : SyncDb) -> SyncOp

    sync_db_create

    fn sync_db_create(db : SyncDb) -> SyncOp

    sync_db_new

    fn sync_db_new(path : Bytes, remote_url : Bytes, client_name : Bytes, long_poll_timeout_ms : Int, bootstrap_if_empty : Bool) -> SyncDb

    sync_db_push

    fn sync_db_push(db : SyncDb) -> SyncOp

    sync_db_stats

    fn sync_db_stats(db : SyncDb) -> SyncOp

    sync_db_step_callbacks

    fn sync_db_step_callbacks(db : SyncDb) -> Int

    sync_db_take_io

    fn sync_db_take_io(db : SyncDb) -> SyncIo

    sync_db_wait_changes

    fn sync_db_wait_changes(db : SyncDb) -> SyncOp

    sync_io_close

    fn sync_io_close(item : SyncIo) -> Unit

    sync_io_done

    fn sync_io_done(item : SyncIo) -> Int

    sync_io_full_read_path

    fn sync_io_full_read_path(item : SyncIo) -> Bytes

    sync_io_full_write_content

    fn sync_io_full_write_content(item : SyncIo) -> Bytes

    sync_io_full_write_path

    fn sync_io_full_write_path(item : SyncIo) -> Bytes

    sync_io_http_body

    fn sync_io_http_body(item : SyncIo) -> Bytes

    sync_io_http_header_count

    fn sync_io_http_header_count(item : SyncIo) -> Int

    sync_io_http_header_key

    fn sync_io_http_header_key(item : SyncIo, index : Int) -> Bytes

    sync_io_http_header_value

    fn sync_io_http_header_value(item : SyncIo, index : Int) -> Bytes

    sync_io_http_method

    fn sync_io_http_method(item : SyncIo) -> Bytes

    sync_io_http_path

    fn sync_io_http_path(item : SyncIo) -> Bytes

    sync_io_http_url

    fn sync_io_http_url(item : SyncIo) -> Bytes

    sync_io_is_null

    fn sync_io_is_null(item : SyncIo) -> Bool

    sync_io_kind

    fn sync_io_kind(item : SyncIo) -> Int

    sync_io_poison

    fn sync_io_poison(item : SyncIo, message : Bytes) -> Int

    sync_io_push_buffer

    fn sync_io_push_buffer(item : SyncIo, buffer : Bytes) -> Int

    sync_io_status

    fn sync_io_status(item : SyncIo, status_code : Int) -> Int

    sync_op_close

    fn sync_op_close(op : SyncOp) -> Unit

    sync_op_extract_changes

    fn sync_op_extract_changes(op : SyncOp) -> SyncChanges

    sync_op_extract_connection

    fn sync_op_extract_connection(op : SyncOp, db : SyncDb) -> Conn

    sync_op_extract_stats

    fn sync_op_extract_stats(op : SyncOp) -> SyncStats

    sync_op_result_kind

    fn sync_op_result_kind(op : SyncOp) -> Int

    sync_op_resume

    fn sync_op_resume(op : SyncOp) -> Int

    sync_stats_cdc_operations

    fn sync_stats_cdc_operations(stats : SyncStats) -> Int64

    sync_stats_close

    fn sync_stats_close(stats : SyncStats) -> Unit

    sync_stats_last_pull_unix_time

    fn sync_stats_last_pull_unix_time(stats : SyncStats) -> Int64

    sync_stats_last_push_unix_time

    fn sync_stats_last_push_unix_time(stats : SyncStats) -> Int64

    sync_stats_main_wal_size

    fn sync_stats_main_wal_size(stats : SyncStats) -> Int64

    sync_stats_network_received_bytes

    fn sync_stats_network_received_bytes(stats : SyncStats) -> Int64

    sync_stats_network_sent_bytes

    fn sync_stats_network_sent_bytes(stats : SyncStats) -> Int64

    sync_stats_revert_wal_size

    fn sync_stats_revert_wal_size(stats : SyncStats) -> Int64

    sync_stats_revision

    fn sync_stats_revision(stats : SyncStats) -> Bytes

    Source Files