Versions in this module Expand all Collapse all v0 v0.0.4 Jan 9, 2026 Changes in this version type SQLSMALLINT + const SQL_BOOLEAN v0.0.3 Dec 25, 2025 v0.0.2 Dec 25, 2025 v0.0.1 Dec 25, 2025 Changes in this version + const SQLStateColumnNotFound + const SQLStateConnectionError + const SQLStateConnectionFailure + const SQLStateConnectionNotOpen + const SQLStateConnectionRejected + const SQLStateConnectionTimeout + const SQLStateConstraintViolation + const SQLStateDataTruncation + const SQLStateDeadlock + const SQLStateDivisionByZero + const SQLStateDuplicateKey + const SQLStateFunctionSequenceError + const SQLStateGeneralError + const SQLStateInvalidAttrValue + const SQLStateInvalidCursorState + const SQLStateInvalidDatetime + const SQLStateInvalidDescIndex + const SQLStateInvalidStringLength + const SQLStateInvalidTransState + const SQLStateMemoryAllocationError + const SQLStateNoData + const SQLStateNumericOverflow + const SQLStateOptionChanged + const SQLStateStringTruncation + const SQLStateSyntaxError + const SQLStateTableNotFound + const SQLStateTimeout + const SQLStateTransactionFailed + const SQL_AUTOCOMMIT_OFF + const SQL_AUTOCOMMIT_ON + const SQL_CURSOR_DYNAMIC + const SQL_CURSOR_FORWARD_ONLY + const SQL_CURSOR_KEYSET_DRIVEN + const SQL_CURSOR_STATIC + const SQL_C_BINARY + const SQL_C_BIT + const SQL_C_CHAR + const SQL_C_DATE + const SQL_C_DEFAULT + const SQL_C_DOUBLE + const SQL_C_FLOAT + const SQL_C_GUID + const SQL_C_INTERVAL_DAY + const SQL_C_INTERVAL_DAY_TO_HOUR + const SQL_C_INTERVAL_DAY_TO_MINUTE + const SQL_C_INTERVAL_DAY_TO_SECOND + const SQL_C_INTERVAL_HOUR + const SQL_C_INTERVAL_HOUR_TO_MINUTE + const SQL_C_INTERVAL_HOUR_TO_SECOND + const SQL_C_INTERVAL_MINUTE + const SQL_C_INTERVAL_MINUTE_TO_SECOND + const SQL_C_INTERVAL_MONTH + const SQL_C_INTERVAL_SECOND + const SQL_C_INTERVAL_YEAR + const SQL_C_INTERVAL_YEAR_TO_MONTH + const SQL_C_LONG + const SQL_C_NUMERIC + const SQL_C_SBIGINT + const SQL_C_SHORT + const SQL_C_SLONG + const SQL_C_SSHORT + const SQL_C_STINYINT + const SQL_C_TIME + const SQL_C_TIMESTAMP + const SQL_C_UBIGINT + const SQL_C_ULONG + const SQL_C_USHORT + const SQL_C_UTINYINT + const SQL_C_WCHAR + const SQL_MODE_READ_ONLY + const SQL_MODE_READ_WRITE + const SQL_NONSCROLLABLE + const SQL_OV_ODBC2 + const SQL_OV_ODBC3 + const SQL_PARAM_BIND_BY_COLUMN + const SQL_PARAM_DIAG_UNAVAILABLE + const SQL_PARAM_ERROR + const SQL_PARAM_SUCCESS + const SQL_PARAM_SUCCESS_WITH_INFO + const SQL_PARAM_UNUSED + const SQL_SCROLLABLE + const SQL_TXN_READ_COMMITTED + const SQL_TXN_READ_UNCOMMITTED + const SQL_TXN_REPEATABLE_READ + const SQL_TXN_SERIALIZABLE + func ColAttribute(stmt SQLHSTMT, colNum SQLUSMALLINT, fieldId SQLUSMALLINT, charAttr []byte) (strLen SQLSMALLINT, numAttr SQLLEN, ret SQLRETURN) + func DescribeCol(stmt SQLHSTMT, colNum SQLUSMALLINT, colName []byte) (nameLen SQLSMALLINT, dataType SQLSMALLINT, colSize SQLULEN, ...) + func DriverConnect(dbc SQLHDBC, hwnd uintptr, inConnStr string, outConnStr []byte, ...) (outLen SQLSMALLINT, ret SQLRETURN) + func FormatReturnCode(ret SQLRETURN) string + func GetDiagRec(handleType SQLSMALLINT, handle SQLHANDLE, recNum SQLSMALLINT, sqlState []byte, ...) (nativeError SQLINTEGER, msgLen SQLSMALLINT, ret SQLRETURN) + func GetInfo(dbc SQLHDBC, infoType SQLUSMALLINT, infoValue []byte) (stringLength SQLSMALLINT, ret SQLRETURN) + func IsConnectionError(err error) bool + func IsDataTruncation(err error) bool + func IsRetryable(err error) bool + func IsSuccess(ret SQLRETURN) bool + func NewError(handleType SQLSMALLINT, handle SQLHANDLE) error + func SQLTypeName(sqlType SQLSMALLINT) string + type BatchResult struct + Errors []error + RowCounts []int64 + TotalRowsAffected int64 + func (r *BatchResult) HasErrors() bool + type ColumnBuffer struct + CType SQLSMALLINT + ColSize SQLULEN + Data interface{} + DecDigits SQLSMALLINT + ElemSize int + Lengths []SQLLEN + SQLType SQLSMALLINT + func AllocateColumnArray(values []interface{}, numRows int) (*ColumnBuffer, error) + func (cb *ColumnBuffer) GetColumnBufferPtr() uintptr + type Conn struct + func (c *Conn) Begin() (driver.Tx, error) + func (c *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) + func (c *Conn) CheckNamedValue(nv *driver.NamedValue) error + func (c *Conn) Close() error + func (c *Conn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) + func (c *Conn) IsValid() bool + func (c *Conn) Ping(ctx context.Context) error + func (c *Conn) Prepare(query string) (driver.Stmt, error) + func (c *Conn) PrepareContext(ctx context.Context, query string) (driver.Stmt, error) + func (c *Conn) PrepareWithCursor(ctx context.Context, query string, cursorType CursorType) (driver.Stmt, error) + func (c *Conn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error) + func (c *Conn) ResetSession(ctx context.Context) error + type Connector struct + DefaultTimestampPrecision TimestampPrecision + DefaultTimezone *time.Location + LastInsertIdBehavior LastInsertIdBehavior + QueryTimeout time.Duration + func (c *Connector) Connect(ctx context.Context) (driver.Conn, error) + func (c *Connector) Driver() driver.Driver + type ConnectorOption func(*Connector) + func WithLastInsertIdBehavior(behavior LastInsertIdBehavior) ConnectorOption + func WithQueryTimeout(d time.Duration) ConnectorOption + func WithTimestampPrecision(precision TimestampPrecision) ConnectorOption + func WithTimezone(tz *time.Location) ConnectorOption + type CursorType int + const CursorDynamic + const CursorForwardOnly + const CursorKeyset + const CursorStatic + type Decimal struct + Precision int + Scale int + Value string + func NewDecimal(value string, precision, scale int) (Decimal, error) + func ParseDecimal(s string) (Decimal, error) + type DecimalError struct + Message string + func (e *DecimalError) Error() string + type DiagRecord struct + Message string + NativeError int32 + SQLState string + func GetDiagRecords(handleType SQLSMALLINT, handle SQLHANDLE) []DiagRecord + type Driver struct + func (d *Driver) Open(name string) (driver.Conn, error) + func (d *Driver) OpenConnector(name string) (driver.Connector, error) + func (d *Driver) OpenConnectorWithOptions(name string, opts ...ConnectorOption) (*Connector, error) + type Error struct + Message string + NativeError int32 + SQLState string + func (e *Error) Error() string + func (e *Error) Is(target error) bool + func (e *Error) Unwrap() error + type Errors []Error + func (e Errors) Error() string + type GUID [16]byte + func ParseGUID(s string) (GUID, error) + type IntervalDaySecond struct + Days int + Hours int + Minutes int + Nanoseconds int + Negative bool + Seconds int + func (i IntervalDaySecond) ToDuration() time.Duration + type IntervalYearMonth struct + Months int + Negative bool + Years int + type LastInsertIdBehavior int + const LastInsertIdAuto + const LastInsertIdDisabled + const LastInsertIdReturning + type NamedParams struct + Names []string + Positions map[string][]int + Query string + func ParseNamedParams(query string) *NamedParams + type OutputParam struct + Direction ParamDirection + Size int + Value interface{} + func NewInputOutputParam(value interface{}) OutputParam + func NewInputOutputParamWithSize(value interface{}, size int) OutputParam + func NewOutputParam(typeHint interface{}) OutputParam + func NewOutputParamWithSize(typeHint interface{}, size int) OutputParam + type ParamDirection int + const ParamInput + const ParamInputOutput + const ParamOutput + type ParameterError struct + Message string + Name string + func (e *ParameterError) Error() string + type Result struct + func (r *Result) LastInsertId() (int64, error) + func (r *Result) OutputParam(index int) interface{} + func (r *Result) OutputParams() []interface{} + func (r *Result) RowsAffected() (int64, error) + type Rows struct + func (r *Rows) Absolute(row int64) error + func (r *Rows) Close() error + func (r *Rows) ColumnTypeDatabaseTypeName(index int) string + func (r *Rows) ColumnTypeLength(index int) (length int64, ok bool) + func (r *Rows) ColumnTypeNullable(index int) (nullable, ok bool) + func (r *Rows) ColumnTypePrecisionScale(index int) (precision, scale int64, ok bool) + func (r *Rows) ColumnTypeScanType(index int) reflect.Type + func (r *Rows) Columns() []string + func (r *Rows) First() error + func (r *Rows) GetRowData(dest []driver.Value) error + func (r *Rows) HasNextResultSet() bool + func (r *Rows) Last() error + func (r *Rows) Next(dest []driver.Value) error + func (r *Rows) NextResultSet() error + func (r *Rows) Prior() error + func (r *Rows) Relative(offset int64) error + type SQLCHAR byte + type SQLHANDLE uintptr + const SQL_NULL_HANDLE + type SQLHDBC SQLHANDLE + type SQLHDESC SQLHANDLE + type SQLHENV SQLHANDLE + type SQLHSTMT SQLHANDLE + type SQLINTEGER int32 + const SQL_ATTR_ACCESS_MODE + const SQL_ATTR_AUTOCOMMIT + const SQL_ATTR_CONCURRENCY + const SQL_ATTR_CONNECTION_DEAD + const SQL_ATTR_CONNECTION_POOLING + const SQL_ATTR_CP_MATCH + const SQL_ATTR_CURSOR_SCROLLABLE + const SQL_ATTR_CURSOR_SENSITIVITY + const SQL_ATTR_CURSOR_TYPE + const SQL_ATTR_LOGIN_TIMEOUT + const SQL_ATTR_MAX_ROWS + const SQL_ATTR_ODBC_VERSION + const SQL_ATTR_OUTPUT_NTS + const SQL_ATTR_PARAMSET_SIZE + const SQL_ATTR_PARAMS_PROCESSED_PTR + const SQL_ATTR_PARAM_BIND_TYPE + const SQL_ATTR_PARAM_STATUS_PTR + const SQL_ATTR_QUERY_TIMEOUT + const SQL_ATTR_ROWS_FETCHED + const SQL_ATTR_ROW_ARRAY_SIZE + const SQL_ATTR_ROW_STATUS_PTR + const SQL_ATTR_TXN_ISOLATION + const SQL_NTS + type SQLLEN int64 + const SQL_DATA_AT_EXEC + const SQL_NULL_DATA + type SQLRETURN SQLSMALLINT + const SQL_ERROR + const SQL_INVALID_HANDLE + const SQL_NEED_DATA + const SQL_NO_DATA + const SQL_STILL_EXECUTING + const SQL_SUCCESS + const SQL_SUCCESS_WITH_INFO + func AllocHandle(handleType SQLSMALLINT, inputHandle SQLHANDLE, outputHandle *SQLHANDLE) SQLRETURN + func BindParameter(stmt SQLHSTMT, paramNum SQLUSMALLINT, ioType SQLSMALLINT, ...) SQLRETURN + func Cancel(stmt SQLHSTMT) SQLRETURN + func CloseCursor(stmt SQLHSTMT) SQLRETURN + func Disconnect(dbc SQLHDBC) SQLRETURN + func EndTran(handleType SQLSMALLINT, handle SQLHANDLE, completionType SQLSMALLINT) SQLRETURN + func ExecDirect(stmt SQLHSTMT, query string) SQLRETURN + func Execute(stmt SQLHSTMT) SQLRETURN + func Fetch(stmt SQLHSTMT) SQLRETURN + func FetchScroll(stmt SQLHSTMT, fetchOrientation SQLSMALLINT, fetchOffset SQLLEN) SQLRETURN + func FreeHandle(handleType SQLSMALLINT, handle SQLHANDLE) SQLRETURN + func FreeStmt(stmt SQLHSTMT, option SQLUSMALLINT) SQLRETURN + func GetData(stmt SQLHSTMT, colNum SQLUSMALLINT, targetType SQLSMALLINT, ...) SQLRETURN + func MoreResults(stmt SQLHSTMT) SQLRETURN + func NumParams(stmt SQLHSTMT, paramCount *SQLSMALLINT) SQLRETURN + func NumResultCols(stmt SQLHSTMT, columnCount *SQLSMALLINT) SQLRETURN + func Prepare(stmt SQLHSTMT, query string) SQLRETURN + func RowCount(stmt SQLHSTMT, rowCount *SQLLEN) SQLRETURN + func SetConnectAttr(dbc SQLHDBC, attribute SQLINTEGER, value uintptr, stringLength SQLINTEGER) SQLRETURN + func SetEnvAttr(env SQLHENV, attribute SQLINTEGER, value uintptr, stringLength SQLINTEGER) SQLRETURN + func SetStmtAttr(stmt SQLHSTMT, attribute SQLINTEGER, value uintptr, stringLength SQLINTEGER) SQLRETURN + type SQLSCHAR int8 + type SQLSMALLINT int16 + const SQL_BIGINT + const SQL_BINARY + const SQL_BIT + const SQL_CHAR + const SQL_COMMIT + const SQL_DATETIME + const SQL_DECIMAL + const SQL_DOUBLE + const SQL_FETCH_ABSOLUTE + const SQL_FETCH_FIRST + const SQL_FETCH_LAST + const SQL_FETCH_NEXT + const SQL_FETCH_PRIOR + const SQL_FETCH_RELATIVE + const SQL_FLOAT + const SQL_GUID + const SQL_HANDLE_DBC + const SQL_HANDLE_DESC + const SQL_HANDLE_ENV + const SQL_HANDLE_STMT + const SQL_INTEGER + const SQL_INTERVAL_DAY + const SQL_INTERVAL_DAY_TO_HOUR + const SQL_INTERVAL_DAY_TO_MINUTE + const SQL_INTERVAL_DAY_TO_SECOND + const SQL_INTERVAL_HOUR + const SQL_INTERVAL_HOUR_TO_MINUTE + const SQL_INTERVAL_HOUR_TO_SECOND + const SQL_INTERVAL_MINUTE + const SQL_INTERVAL_MINUTE_TO_SECOND + const SQL_INTERVAL_MONTH + const SQL_INTERVAL_SECOND + const SQL_INTERVAL_YEAR + const SQL_INTERVAL_YEAR_TO_MONTH + const SQL_LONGVARBINARY + const SQL_LONGVARCHAR + const SQL_NO_NULLS + const SQL_NULLABLE + const SQL_NULLABLE_UNKNOWN + const SQL_NUMERIC + const SQL_PARAM_INPUT + const SQL_PARAM_INPUT_OUTPUT + const SQL_PARAM_OUTPUT + const SQL_REAL + const SQL_ROLLBACK + const SQL_SIGNED_OFFSET + const SQL_SMALLINT + const SQL_TINYINT + const SQL_TYPE_DATE + const SQL_TYPE_TIME + const SQL_TYPE_TIMESTAMP + const SQL_UNKNOWN_TYPE + const SQL_UNSIGNED_OFFSET + const SQL_VARBINARY + const SQL_VARCHAR + const SQL_WCHAR + const SQL_WLONGVARCHAR + const SQL_WVARCHAR + type SQLUINTEGER uint32 + type SQLULEN uint64 + type SQLUSMALLINT uint16 + const SQL_CLOSE + const SQL_COLUMN_LENGTH + const SQL_COLUMN_PRECISION + const SQL_COLUMN_SCALE + const SQL_DATABASE_NAME + const SQL_DBMS_NAME + const SQL_DBMS_VER + const SQL_DESC_ALLOC_TYPE + const SQL_DESC_AUTO_UNIQUE_VALUE + const SQL_DESC_BASE_COLUMN_NAME + const SQL_DESC_BASE_TABLE_NAME + const SQL_DESC_CATALOG_NAME + const SQL_DESC_CONCISE_TYPE + const SQL_DESC_COUNT + const SQL_DESC_DATA_PTR + const SQL_DESC_DATETIME_INTERVAL_CODE + const SQL_DESC_DISPLAY_SIZE + const SQL_DESC_INDICATOR_PTR + const SQL_DESC_LABEL + const SQL_DESC_LENGTH + const SQL_DESC_NAME + const SQL_DESC_NULLABLE + const SQL_DESC_OCTET_LENGTH + const SQL_DESC_OCTET_LENGTH_PTR + const SQL_DESC_PRECISION + const SQL_DESC_SCALE + const SQL_DESC_SCHEMA_NAME + const SQL_DESC_TABLE_NAME + const SQL_DESC_TYPE + const SQL_DESC_TYPE_NAME + const SQL_DESC_UNNAMED + const SQL_DESC_UNSIGNED + const SQL_DESC_UPDATABLE + const SQL_DRIVER_COMPLETE + const SQL_DRIVER_COMPLETE_REQUIRED + const SQL_DRIVER_NAME + const SQL_DRIVER_NOPROMPT + const SQL_DRIVER_PROMPT + const SQL_DRIVER_VER + const SQL_DROP + const SQL_IDENTIFIER_QUOTE_CHAR + const SQL_MAX_IDENTIFIER_LEN + const SQL_RESET_PARAMS + const SQL_SERVER_NAME + const SQL_UNBIND + const SQL_USER_NAME + type SQLWCHAR uint16 + type SQL_DATE_STRUCT struct + Day SQLUSMALLINT + Month SQLUSMALLINT + Year SQLSMALLINT + type SQL_DAY_SECOND_STRUCT struct + Day SQLUINTEGER + Fraction SQLUINTEGER + Hour SQLUINTEGER + Minute SQLUINTEGER + Second SQLUINTEGER + type SQL_GUID_STRUCT struct + Data1 uint32 + Data2 uint16 + Data3 uint16 + Data4 [8]byte + func (g SQL_GUID_STRUCT) String() string + type SQL_INTERVAL_STRUCT struct + DaySecond SQL_DAY_SECOND_STRUCT + IntervalSign SQLSMALLINT + IntervalType SQLSMALLINT + YearMonth SQL_YEAR_MONTH_STRUCT + type SQL_NUMERIC_STRUCT struct + Precision SQLCHAR + Scale SQLSCHAR + Sign SQLCHAR + Val [16]SQLCHAR + type SQL_TIMESTAMP_STRUCT struct + Day SQLUSMALLINT + Fraction SQLUINTEGER + Hour SQLUSMALLINT + Minute SQLUSMALLINT + Month SQLUSMALLINT + Second SQLUSMALLINT + Year SQLSMALLINT + type SQL_TIME_STRUCT struct + Hour SQLUSMALLINT + Minute SQLUSMALLINT + Second SQLUSMALLINT + type SQL_YEAR_MONTH_STRUCT struct + Month SQLUINTEGER + Year SQLUINTEGER + type ScrollableRows interface + Absolute func(row int64) error + First func() error + Last func() error + Prior func() error + Relative func(offset int64) error + type Stmt struct + func (s *Stmt) Close() error + func (s *Stmt) Exec(args []driver.Value) (driver.Result, error) + func (s *Stmt) ExecBatch(ctx context.Context, paramSets [][]driver.NamedValue) (*BatchResult, error) + func (s *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (driver.Result, error) + func (s *Stmt) NumInput() int + func (s *Stmt) Query(args []driver.Value) (driver.Rows, error) + func (s *Stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) + type Timestamp struct + Precision TimestampPrecision + Time time.Time + func NewTimestamp(t time.Time, precision TimestampPrecision) Timestamp + type TimestampPrecision int + const TimestampPrecisionMicroseconds + const TimestampPrecisionMilliseconds + const TimestampPrecisionNanoseconds + const TimestampPrecisionSeconds + type TimestampTZ struct + Precision TimestampPrecision + TZ *time.Location + Time time.Time + func NewTimestampTZ(t time.Time, precision TimestampPrecision, tz *time.Location) TimestampTZ + type Tx struct + func (t *Tx) Commit() error + func (t *Tx) Rollback() error + type WideString string