v2026.4.1
All Bundles

Connection

ODBC database connection

Operations

Close

Closes a connection

method : public : Close() ~ Nil

Commit

Commits the current transaction.

method : public : Commit() ~ Bool

Return

TypeDescription
Booltrue if successful

CreateParameterStatement

Create a parametrized SQL statement

method : public : CreateParameterStatement(sql:String) ~ ParameterStatement

Parameters

NameTypeDescription
sqlStringSQL statement

Return

TypeDescription
ParameterStatementresult set

GetColumns

Gets column information for a table as name:type pairs.

method : public : GetColumns(table:String) ~ String[]

Parameters

NameTypeDescription
tableStringtable name

Return

TypeDescription
Stringarray of column descriptors (name:type), or Nil on failure

GetLastError

Gets the last error message from the connection.

method : public : GetLastError() ~ String

Return

TypeDescription
Stringerror message string, or empty if no error

GetTables

Gets the list of table names in the data source.

method : public : GetTables() ~ String[]

Return

TypeDescription
Stringarray of table names, or Nil on failure

IsOpen

Check rather a connect is open

method : public : IsOpen() ~ Bool

Return

TypeDescription
Booltrue if connected, false otherwise

New

Constructor

New(ds:String, username:String, password:String)

Parameters

NameTypeDescription
dsStringODBC data source
usernameStringODBC connection name
passwordStringODBC connection password

New

Constructor using a connection string

New(conn_str:String)

Parameters

NameTypeDescription
conn_strStringODBC connection string (e.g. "Driver={SQL Server};Server=localhost;Database=mydb;Uid=user;Pwd=pass;")

Rollback

Rolls back the current transaction.

method : public : Rollback() ~ Bool

Return

TypeDescription
Booltrue if successful

Select

Executes a SQL select statement

method : public : Select(sql:String) ~ ResultSet

Parameters

NameTypeDescription
sqlStringSQL statement

Return

TypeDescription
ResultSetresult set

SetAutoCommit

Sets autocommit mode. When false, changes must be explicitly committed.

method : public : SetAutoCommit(enable:Bool) ~ Bool

Parameters

NameTypeDescription
enableBooltrue for autocommit, false for manual transaction control

Return

TypeDescription
Booltrue if successful

Update

Executes a SQL update statement

method : public : Update(sql:String) ~ Int

Parameters

NameTypeDescription
sqlStringSQL statement

Return

TypeDescription
Intresult code