Connection¶
Non-sendable database connection wrapping SQLHDBC (and its own SQLHENV). All methods check internal state and return errors for misuse.
Public Functions¶
exec¶
Execute a non-parameterized statement via SQLExecDirect. Returns affected row count, or None for DDL.
Parameters¶
- sql: String val
Returns¶
exec_p¶
Partial variant of exec(). Raises error on failure. For try/else chaining of multiple statements.
Parameters¶
- sql: String val
Returns¶
- RowCount ?
prepare¶
Prepare a statement for parameter binding and repeated execution.
Parameters¶
- sql: String val
Returns¶
- (Statement ref | PrepareError val)
prepare_p¶
Partial variant of prepare(). Raises error on failure.
Parameters¶
- sql: String val
Returns¶
- Statement ref ?
query¶
Execute a SELECT via SQLExecDirect and return a Cursor.
Parameters¶
- sql: String val
Returns¶
query_p¶
Partial variant of query(). Raises error on failure.
Parameters¶
- sql: String val
Returns¶
- Cursor ref ?
begin¶
Set autocommit off. Returns error if already in a transaction or if the connection is closed.
Returns¶
- (TxBegun val | TxBeginError val)
commit¶
Commit the current transaction and re-enable autocommit.
Returns¶
- (TxCommitted val | TxCommitError val)
rollback¶
Rollback the current transaction and re-enable autocommit.
Returns¶
- (TxRolledBack val | TxRollbackError val)
begin_p¶
Partial variant of begin(). Raises error on failure.
Returns¶
- None val ?
commit_p¶
Partial variant of commit(). Raises error on failure.
Returns¶
- None val ?
rollback_p¶
Partial variant of rollback(). Raises error on failure.
Returns¶
- None val ?
last_warnings¶
Returns¶
close¶
Close the connection. Idempotent. Auto-rollbacks if in a transaction. Sets shared _alive flag to false.
Returns¶
- None val