ms_access

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddField

func AddField(table string, f Field) string

func AlterField

func AlterField(table string, f Field) string

func CreateTable

func CreateTable(name string, fields ...Field) string

CreateTable creates a table

func DeleteRow

func DeleteRow(table string, where map[Field]any) string

DeleteRow deletes a row

func DropField

func DropField(table, field string) string

func DropTable

func DropTable(name string) string

DropTable removes a table

func InsertRow

func InsertRow(table string, values map[Field]any) string

InsertRow inserts a row

func InsertRows

func InsertRows(table string, fields []Field, rows [][]any) (string, error)

InsertRows inserts several rows, the order and length of the fields and each row must match

func QuoteString added in v0.0.6

func QuoteString(s string) (sql string)

func UpdateRow

func UpdateRow(table string, values map[Field]any, where map[Field]any) string

UpdateRow updates a row

Types

type Connection

type Connection struct {
	DSN string
	PW  string
	UID string
	DB  *sql.DB
}

func NewConnection

func NewConnection(dsn, passwd string) *Connection

NewConnection creates a new ODBC connection

func (*Connection) Close

func (m *Connection) Close() error

Close closes the ODBC connection

func (*Connection) Open

func (m *Connection) Open() error

Open opens the odbc connection

type Field

type Field struct {
	Name string
	Type Type
	Null bool
	Size [2]int
}

func (Field) Sql

func (f Field) Sql() string

type Type added in v0.0.3

type Type string
var (
	Type_COUNTER  Type = "COUNTER"
	Type_BYTE     Type = "BYTE"
	Type_SMALLINT Type = "SMALLINT"
	Type_INTEGER  Type = "INTEGER"
	Type_REAL     Type = "REAL"
	Type_FLOAT    Type = "FLOAT"
	// Type_DECIMAL(18,5) FieldType = "DECIMAL(18,5)"
	Type_MONEY            Type = "MONEY"
	Type_VARCHAR          Type = "VARCHAR"
	Type_MEMO             Type = "MEMO"
	Type_DATETIME         Type = "DATETIME"
	Type_BIT              Type = "BIT"
	Type_IMAGE            Type = "IMAGE"
	Type_UNIQUEIDENTIFIER Type = "UNIQUEIDENTIFIER"
)

Jump to

Keyboard shortcuts

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