api

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2024 License: BSD-3-Clause Imports: 6 Imported by: 9

Documentation

Index

Constants

View Source
const (
	SQL_OV_ODBC3 = uintptr(C.SQL_OV_ODBC3)

	SQL_ATTR_ODBC_VERSION = C.SQL_ATTR_ODBC_VERSION

	SQL_DRIVER_NOPROMPT = C.SQL_DRIVER_NOPROMPT

	SQL_HANDLE_ENV  = C.SQL_HANDLE_ENV
	SQL_HANDLE_DBC  = C.SQL_HANDLE_DBC
	SQL_HANDLE_STMT = C.SQL_HANDLE_STMT

	SQL_SUCCESS            = C.SQL_SUCCESS
	SQL_SUCCESS_WITH_INFO  = C.SQL_SUCCESS_WITH_INFO
	SQL_INVALID_HANDLE     = C.SQL_INVALID_HANDLE
	SQL_NO_DATA            = C.SQL_NO_DATA
	SQL_NO_TOTAL           = C.SQL_NO_TOTAL
	SQL_NTS                = C.SQL_NTS
	SQL_MAX_MESSAGE_LENGTH = C.SQL_MAX_MESSAGE_LENGTH
	SQL_NULL_HANDLE        = uintptr(C.SQL_NULL_HANDLE)
	SQL_NULL_HENV          = uintptr(C.SQL_NULL_HENV)
	SQL_NULL_HDBC          = uintptr(C.SQL_NULL_HDBC)
	SQL_NULL_HSTMT         = uintptr(C.SQL_NULL_HSTMT)

	SQL_PARAM_INPUT        = C.SQL_PARAM_INPUT
	SQL_PARAM_OUTPUT       = C.SQL_PARAM_OUTPUT
	SQL_PARAM_INPUT_OUTPUT = C.SQL_PARAM_INPUT_OUTPUT

	SQL_NULL_DATA    = C.SQL_NULL_DATA
	SQL_DATA_AT_EXEC = C.SQL_DATA_AT_EXEC

	SQL_UNKNOWN_TYPE    = C.SQL_UNKNOWN_TYPE
	SQL_CHAR            = C.SQL_CHAR
	SQL_NUMERIC         = C.SQL_NUMERIC
	SQL_DECIMAL         = C.SQL_DECIMAL
	SQL_INTEGER         = C.SQL_INTEGER
	SQL_SMALLINT        = C.SQL_SMALLINT
	SQL_FLOAT           = C.SQL_FLOAT
	SQL_REAL            = C.SQL_REAL
	SQL_DOUBLE          = C.SQL_DOUBLE
	SQL_DATETIME        = C.SQL_DATETIME
	SQL_DATE            = C.SQL_DATE
	SQL_TIME            = C.SQL_TIME
	SQL_VARCHAR         = C.SQL_VARCHAR
	SQL_TYPE_DATE       = C.SQL_TYPE_DATE
	SQL_TYPE_TIME       = C.SQL_TYPE_TIME
	SQL_TYPE_TIMESTAMP  = C.SQL_TYPE_TIMESTAMP
	SQL_TIMESTAMP       = C.SQL_TIMESTAMP
	SQL_LONGVARCHAR     = C.SQL_LONGVARCHAR
	SQL_BINARY          = C.SQL_BINARY
	SQL_VARBINARY       = C.SQL_VARBINARY
	SQL_LONGVARBINARY   = C.SQL_LONGVARBINARY
	SQL_BIGINT          = C.SQL_BIGINT
	SQL_TINYINT         = C.SQL_TINYINT
	SQL_BIT             = C.SQL_BIT
	SQL_WCHAR           = C.SQL_WCHAR
	SQL_WVARCHAR        = C.SQL_WVARCHAR
	SQL_WLONGVARCHAR    = C.SQL_WLONGVARCHAR
	SQL_GUID            = C.SQL_GUID
	SQL_BLOB            = C.SQL_BLOB
	SQL_CLOB            = C.SQL_CLOB
	SQL_SIGNED_OFFSET   = C.SQL_SIGNED_OFFSET
	SQL_UNSIGNED_OFFSET = C.SQL_UNSIGNED_OFFSET
	SQL_DBCLOB          = C.SQL_DBCLOB
	SQL_BOOLEAN         = C.SQL_BOOLEAN
	SQL_XML             = C.SQL_XML

	// TODO(lukemauldin): Not defined in sqlext.h. Using windows value, but it is not supported.
	SQL_SS_XML = -152

	SQL_C_CHAR           = C.SQL_C_CHAR
	SQL_C_LONG           = C.SQL_C_LONG
	SQL_C_SHORT          = C.SQL_C_SHORT
	SQL_C_FLOAT          = C.SQL_C_FLOAT
	SQL_C_DOUBLE         = C.SQL_C_DOUBLE
	SQL_C_NUMERIC        = C.SQL_C_NUMERIC
	SQL_C_DATE           = C.SQL_C_DATE
	SQL_C_TIME           = C.SQL_C_TIME
	SQL_C_TYPE_TIMESTAMP = C.SQL_C_TYPE_TIMESTAMP
	SQL_C_TIMESTAMP      = C.SQL_C_TIMESTAMP
	SQL_C_BINARY         = C.SQL_C_BINARY
	SQL_C_BIT            = C.SQL_C_BIT
	SQL_C_WCHAR          = C.SQL_C_WCHAR
	SQL_C_DEFAULT        = C.SQL_C_DEFAULT
	SQL_C_SBIGINT        = C.SQL_C_SBIGINT
	SQL_C_UBIGINT        = C.SQL_C_UBIGINT
	SQL_C_GUID           = C.SQL_C_GUID
	SQL_C_DBCHAR         = C.SQL_C_DBCHAR
	SQL_C_TYPE_DATE      = C.SQL_C_TYPE_DATE
	SQL_C_TYPE_TIME      = C.SQL_C_TYPE_TIME
	SQL_C_XML            = C.SQL_XML

	SQL_COMMIT   = C.SQL_COMMIT
	SQL_ROLLBACK = C.SQL_ROLLBACK

	SQL_AUTOCOMMIT         = C.SQL_AUTOCOMMIT
	SQL_ATTR_AUTOCOMMIT    = C.SQL_ATTR_AUTOCOMMIT
	SQL_AUTOCOMMIT_OFF     = C.SQL_AUTOCOMMIT_OFF
	SQL_AUTOCOMMIT_ON      = C.SQL_AUTOCOMMIT_ON
	SQL_AUTOCOMMIT_DEFAULT = C.SQL_AUTOCOMMIT_DEFAULT
	SQL_DESC_PRECISION     = C.SQL_DESC_PRECISION
	SQL_DESC_SCALE         = C.SQL_DESC_SCALE
	SQL_DESC_LENGTH        = C.SQL_DESC_LENGTH
	SQL_DESC_CONCISE_TYPE  = C.SQL_DESC_CONCISE_TYPE
	SQL_DESC_TYPE_NAME     = C.SQL_DESC_TYPE_NAME
	SQL_COLUMN_TYPE        = C.SQL_COLUMN_TYPE
	SQL_COLUMN_TYPE_NAME   = C.SQL_COLUMN_TYPE_NAME
	MAX_FIELD_SIZE         = 1024
	SQL_DESC_NULLABLE      = C.SQL_DESC_NULLABLE
	SQL_NULLABLE           = C.SQL_NULLABLE
	SQL_NO_NULLS           = C.SQL_NO_NULLS
	SQL_DECFLOAT           = C.SQL_DECFLOAT
	SQL_ATTR_PARAMSET_SIZE = C.SQL_ATTR_PARAMSET_SIZE

	SQL_IS_UINTEGER = C.SQL_IS_UINTEGER
	SQL_IS_INTEGER  = C.SQL_IS_INTEGER

	//Connection pooling
	SQL_ATTR_CONNECTION_POOLING = C.SQL_ATTR_CONNECTION_POOLING
	SQL_ATTR_CP_MATCH           = C.SQL_ATTR_CP_MATCH
	SQL_CP_OFF                  = uintptr(C.SQL_CP_OFF)
	SQL_CP_ONE_PER_DRIVER       = uintptr(C.SQL_CP_ONE_PER_DRIVER)
	SQL_CP_ONE_PER_HENV         = uintptr(C.SQL_CP_ONE_PER_HENV)
	SQL_CP_DEFAULT              = SQL_CP_OFF
	SQL_CP_STRICT_MATCH         = uintptr(C.SQL_CP_STRICT_MATCH)
	SQL_CP_RELAXED_MATCH        = uintptr(C.SQL_CP_RELAXED_MATCH)
)

Variables

This section is empty.

Functions

func Extract added in v0.2.0

func Extract(ptr unsafe.Pointer, size uintptr) []byte

func ExtractUTF16Str added in v0.2.0

func ExtractUTF16Str(s []uint16) []byte

ExtractUTF16Str uses unsafe package to copy UTF16 string to a byte slice.

func StringToUTF16

func StringToUTF16(s string) []uint16

StringToUTF16 returns the UTF-16 encoding of the UTF-8 string s, with a terminating NUL added. func StringToUTF16(s string) []uint16 { return utf16.Encode([]rune(s + "\u0000")) }

func StringToUTF16Ptr

func StringToUTF16Ptr(s string) *uint16

StringToUTF16Ptr returns pointer to the UTF-16 encoding of the UTF-8 string s, with a terminating NUL added.

func UTF16ToString

func UTF16ToString(s []uint16) string

UTF16ToString returns the UTF-8 encoding of the UTF-16 sequence s, with a terminating NUL removed.

Types

type SQLHANDLE

type SQLHANDLE C.SQLHANDLE

type SQLHDBC

type SQLHDBC C.SQLHDBC

type SQLHENV

type SQLHENV C.SQLHENV

type SQLHSTMT

type SQLHSTMT C.SQLHSTMT

type SQLHWND

type SQLHWND uintptr

type SQLINTEGER

type SQLINTEGER C.SQLINTEGER

type SQLLEN

type SQLLEN C.SQLLEN

type SQLPOINTER

type SQLPOINTER C.SQLPOINTER

type SQLRETURN

type SQLRETURN C.SQLRETURN

func SQLAllocHandle

func SQLAllocHandle(handleType SQLSMALLINT, inputHandle SQLHANDLE, outputHandle *SQLHANDLE) (ret SQLRETURN)

func SQLBindCol

func SQLBindCol(statementHandle SQLHSTMT, columnNumber SQLUSMALLINT, targetType SQLSMALLINT, targetValuePtr []byte, bufferLength SQLLEN, vallen *SQLLEN) (ret SQLRETURN)

func SQLBindParameter

func SQLBindParameter(statementHandle SQLHSTMT, parameterNumber SQLUSMALLINT, inputOutputType SQLSMALLINT, valueType SQLSMALLINT, parameterType SQLSMALLINT, columnSize SQLULEN, decimalDigits SQLSMALLINT, parameterValue SQLPOINTER, bufferLength SQLLEN, ind *SQLLEN) (ret SQLRETURN)

func SQLCloseCursor

func SQLCloseCursor(statementHandle SQLHSTMT) (ret SQLRETURN)

func SQLColAttribute added in v0.1.0

func SQLColAttribute(statementHandle SQLHSTMT, ColumnNumber SQLUSMALLINT, FieldIdentifier SQLUSMALLINT, CharacterAttributePtr SQLPOINTER, BufferLength SQLSMALLINT, StringLengthPtr *SQLSMALLINT, NumericAttributePtr SQLPOINTER) (ret SQLRETURN)

func SQLCreateDb added in v0.3.0

func SQLCreateDb(connectionHandle SQLHDBC, dbnamePtr *SQLWCHAR, dbnameLen SQLINTEGER, codeSetPtr *SQLWCHAR, codeSetLen SQLINTEGER, modePtr *SQLWCHAR, modeLen SQLINTEGER) (ret SQLRETURN)

func SQLDescribeCol

func SQLDescribeCol(statementHandle SQLHSTMT, columnNumber SQLUSMALLINT, columnName *SQLWCHAR, bufferLength SQLSMALLINT, nameLengthPtr *SQLSMALLINT, dataTypePtr *SQLSMALLINT, columnSizePtr *SQLULEN, decimalDigitsPtr *SQLSMALLINT, nullablePtr *SQLSMALLINT) (ret SQLRETURN)

func SQLDescribeParam

func SQLDescribeParam(statementHandle SQLHSTMT, parameterNumber SQLUSMALLINT, dataTypePtr *SQLSMALLINT, parameterSizePtr *SQLULEN, decimalDigitsPtr *SQLSMALLINT, nullablePtr *SQLSMALLINT) (ret SQLRETURN)

func SQLDisconnect

func SQLDisconnect(connectionHandle SQLHDBC) (ret SQLRETURN)

func SQLDriverConnect

func SQLDriverConnect(connectionHandle SQLHDBC, windowHandle SQLHWND, inConnectionString *SQLWCHAR, stringLength1 SQLSMALLINT, outConnectionString *SQLWCHAR, bufferLength SQLSMALLINT, stringLength2Ptr *SQLSMALLINT, driverCompletion SQLUSMALLINT) (ret SQLRETURN)

func SQLDropDb added in v0.3.0

func SQLDropDb(connectionHandle SQLHDBC, dbnamePtr *SQLWCHAR, dbnameLen SQLINTEGER) (ret SQLRETURN)

func SQLEndTran

func SQLEndTran(handleType SQLSMALLINT, handle SQLHANDLE, completionType SQLSMALLINT) (ret SQLRETURN)

func SQLExecDirect added in v0.3.0

func SQLExecDirect(statementHandle SQLHSTMT, statementText *SQLWCHAR, textLength SQLINTEGER) (ret SQLRETURN)

func SQLExecute

func SQLExecute(statementHandle SQLHSTMT) (ret SQLRETURN)

func SQLFetch

func SQLFetch(statementHandle SQLHSTMT) (ret SQLRETURN)

func SQLFreeHandle

func SQLFreeHandle(handleType SQLSMALLINT, handle SQLHANDLE) (ret SQLRETURN)

func SQLGetData

func SQLGetData(statementHandle SQLHSTMT, colOrParamNum SQLUSMALLINT, targetType SQLSMALLINT, targetValuePtr SQLPOINTER, bufferLength SQLLEN, vallen *SQLLEN) (ret SQLRETURN)

func SQLGetDiagRec

func SQLGetDiagRec(handleType SQLSMALLINT, handle SQLHANDLE, recNumber SQLSMALLINT, sqlState *SQLWCHAR, nativeErrorPtr *SQLINTEGER, messageText *SQLWCHAR, bufferLength SQLSMALLINT, textLengthPtr *SQLSMALLINT) (ret SQLRETURN)

func SQLMoreResults added in v0.1.0

func SQLMoreResults(statementHandle SQLHSTMT) (ret SQLRETURN)

func SQLNumParams

func SQLNumParams(statementHandle SQLHSTMT, parameterCountPtr *SQLSMALLINT) (ret SQLRETURN)

func SQLNumResultCols

func SQLNumResultCols(statementHandle SQLHSTMT, columnCountPtr *SQLSMALLINT) (ret SQLRETURN)

func SQLPrepare

func SQLPrepare(statementHandle SQLHSTMT, statementText *SQLWCHAR, textLength SQLINTEGER) (ret SQLRETURN)

func SQLRowCount

func SQLRowCount(statementHandle SQLHSTMT, rowCountPtr *SQLLEN) (ret SQLRETURN)

func SQLSetConnectAttr

func SQLSetConnectAttr(connectionHandle SQLHDBC, attribute SQLINTEGER, valuePtr SQLPOINTER, stringLength SQLINTEGER) (ret SQLRETURN)

func SQLSetConnectUIntPtrAttr added in v0.4.4

func SQLSetConnectUIntPtrAttr(connectionHandle SQLHDBC, attribute SQLINTEGER, valuePtr uintptr, stringLength SQLINTEGER) (ret SQLRETURN)

func SQLSetEnvAttr

func SQLSetEnvAttr(environmentHandle SQLHENV, attribute SQLINTEGER, valuePtr SQLPOINTER, stringLength SQLINTEGER) (ret SQLRETURN)

func SQLSetEnvUIntPtrAttr added in v0.4.4

func SQLSetEnvUIntPtrAttr(environmentHandle SQLHENV, attribute SQLINTEGER, valuePtr uintptr, stringLength SQLINTEGER) (ret SQLRETURN)

func SQLSetStmtAttr added in v0.2.0

func SQLSetStmtAttr(statementHandle SQLHSTMT, attribute SQLINTEGER, valuePtr SQLPOINTER, stringLength SQLINTEGER) (ret SQLRETURN)

type SQLSCHAR

type SQLSCHAR C.SQLSCHAR

type SQLSMALLINT

type SQLSMALLINT C.SQLSMALLINT

type SQLUINTEGER

type SQLUINTEGER C.SQLUINTEGER

type SQLULEN

type SQLULEN C.SQLULEN

type SQLUSMALLINT

type SQLUSMALLINT C.SQLUSMALLINT

type SQLWCHAR

type SQLWCHAR C.SQLWCHAR

type SQL_DATE_STRUCT

type SQL_DATE_STRUCT struct {
	Year  SQLSMALLINT
	Month SQLUSMALLINT
	Day   SQLUSMALLINT
}

type SQL_TIMESTAMP_STRUCT

type SQL_TIMESTAMP_STRUCT struct {
	Year     SQLSMALLINT
	Month    SQLUSMALLINT
	Day      SQLUSMALLINT
	Hour     SQLUSMALLINT
	Minute   SQLUSMALLINT
	Second   SQLUSMALLINT
	Fraction SQLUINTEGER
}

type SQL_TIME_STRUCT added in v0.1.1

type SQL_TIME_STRUCT struct {
	Hour   SQLUSMALLINT
	Minute SQLUSMALLINT
	Second SQLUSMALLINT
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL