Documentation
¶
Overview ¶
Package mssql is meta.Metadata on top of microsoft/go-mssqldb. Queries are not executed: result columns come from sp_describe_first_result_set and parameters from sp_describe_undeclared_parameters (procedures: their parameters), the rest from the sys catalog by the rules of mssql-jdbc DatabaseMetaData, to match the Java plug-in.
Index ¶
- func ConnString(dbURL, user, pwd string) (string, error)
- type DB
- func (db *DB) Close() error
- func (db *DB) Exec(q string) error
- func (db *DB) IdentifierQuote() string
- func (db *DB) ImportedKeys(table string) ([]meta.ImportedKey, error)
- func (db *DB) PKColNames(tableRef string) ([]string, error)
- func (db *DB) RawOfJava(javaType string) string
- func (db *DB) SQLColumns(jdbcSQL string) ([]meta.Column, error)
- func (db *DB) SQLParams(jdbcSQL string, typeCount int) (*meta.Params, error)
- func (db *DB) Table(tableRef string) (*meta.Table, error)
- func (db *DB) Tables(includeViews bool) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnString ¶
ConnString returns the connection string of go-mssqldb for <db url user pwd>. Both forms are accepted:
- go-mssqldb: sqlserver://host:1433?database=Northwind (instance: sqlserver://host/SQLEXPRESS);
- JDBC (with or without "jdbc:"): sqlserver://host:1433;databaseName=Northwind;encrypt=false (instance: host\SQLEXPRESS or instanceName=SQLEXPRESS; integratedSecurity=true: Windows login).
Credentials in the URL take precedence over user and pwd.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func Open ¶
Open connects by a go-mssqldb connection string: sqlserver://user:password@host:1433?database=name.
func (*DB) IdentifierQuote ¶
IdentifierQuote: [] of SQL Server (meta.QuoteName), not the " of getIdentifierQuoteString.
func (*DB) ImportedKeys ¶
func (db *DB) ImportedKeys(table string) ([]meta.ImportedKey, error)
ImportedKeys: getImportedKeys of the table: by PK schema and table, then key order.