Documentation
¶
Index ¶
- Constants
- type Conn
- 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) 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) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
- func (c *Conn) ResetSession(ctx context.Context) error
- type Driver
- type Result
- type Rows
- func (r *Rows) Close() error
- func (r *Rows) ColumnTypeDatabaseTypeName(index int) string
- func (r *Rows) ColumnTypeLength(index int) (int64, bool)
- func (r *Rows) ColumnTypeNullable(index int) (bool, bool)
- func (r *Rows) ColumnTypePrecisionScale(index int) (int64, int64, bool)
- func (r *Rows) ColumnTypeScanType(index int) reflect.Type
- func (r *Rows) Columns() []string
- func (r *Rows) HasNextResultSet() bool
- func (r *Rows) Next(dest []driver.Value) error
- func (r *Rows) NextResultSet() error
- type Stmt
- func (s *Stmt) CheckNamedValue(nv *driver.NamedValue) error
- func (s *Stmt) Close() error
- func (s *Stmt) Exec(args []driver.Value) (driver.Result, 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 ThreadSafeMap
- func (tm *ThreadSafeMap[K, V]) Clear()
- func (tm *ThreadSafeMap[K, V]) CompareAndDelete(key K, old V) (deleted bool)
- func (tm *ThreadSafeMap[K, V]) CompareAndSwap(key K, old, new V) bool
- func (tm *ThreadSafeMap[K, V]) Delete(key K)
- func (tm *ThreadSafeMap[K, V]) Iter() iter.Seq2[K, V]
- func (tm *ThreadSafeMap[K, V]) Keys() iter.Seq[K]
- func (tm *ThreadSafeMap[K, V]) Len() int
- func (tm *ThreadSafeMap[K, V]) Load(key K) (value V, ok bool)
- func (tm *ThreadSafeMap[K, V]) LoadAndDelete(key K) (value V, loaded bool)
- func (tm *ThreadSafeMap[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (tm *ThreadSafeMap[K, V]) Store(key K, value V)
- func (tm *ThreadSafeMap[K, V]) Swap(key K, value V) (previous V, loaded bool)
- func (tm *ThreadSafeMap[K, V]) Values() iter.Seq[V]
- type Tx
Constants ¶
const ( SQLITE_OK = 0 SQLITE_ERROR = 1 SQLITE_INTERNAL = 2 SQLITE_PERM = 3 SQLITE_ABORT = 4 SQLITE_BUSY = 5 SQLITE_LOCKED = 6 SQLITE_NOMEM = 7 SQLITE_READONLY = 8 SQLITE_INTERRUPT = 9 SQLITE_IOERR = 10 SQLITE_CORRUPT = 11 SQLITE_NOTFOUND = 12 SQLITE_FULL = 13 SQLITE_CANTOPEN = 14 SQLITE_PROTOCOL = 15 SQLITE_EMPTY = 16 SQLITE_SCHEMA = 17 SQLITE_TOOBIG = 18 SQLITE_CONSTRAINT = 19 SQLITE_MISMATCH = 20 SQLITE_MISUSE = 21 SQLITE_NOLFS = 22 SQLITE_AUTH = 23 SQLITE_FORMAT = 24 SQLITE_RANGE = 25 SQLITE_NOTADB = 26 SQLITE_NOTICE = 27 SQLITE_WARNING = 28 SQLITE_ROW = 100 SQLITE_DONE = 101 SQLITE_OPEN_READONLY = 0x00000001 SQLITE_OPEN_READWRITE = 0x00000002 SQLITE_OPEN_CREATE = 0x00000004 SQLITE_OPEN_URI = 0x00000040 SQLITE_STATIC = uintptr(0) SQLITE_TRANSIENT = ^uintptr(0) SQLITE_OPEN_MEMORY = 0x00000080 SQLITE_OPEN_NOMUTEX = 0x00008000 SQLITE_OPEN_FULLMUTEX = 0x00010000 SQLITE_OPEN_SHAREDCACHE = 0x00020000 SQLITE_OPEN_PRIVATECACHE = 0x00040000 SQLITE_INTEGER = 1 SQLITE_REAL = 2 SQLITE_TEXT = 3 SQLITE_BLOB = 4 SQLITE_NULL = 5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) CheckNamedValue ¶
func (c *Conn) CheckNamedValue(nv *driver.NamedValue) error
func (*Conn) ExecContext ¶
func (*Conn) PrepareContext ¶
func (*Conn) QueryContext ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
func (*Result) LastInsertId ¶
func (*Result) RowsAffected ¶
type Rows ¶
type Rows struct {
// contains filtered or unexported fields
}
func (*Rows) ColumnTypeDatabaseTypeName ¶
func (*Rows) ColumnTypePrecisionScale ¶
func (*Rows) HasNextResultSet ¶
func (*Rows) NextResultSet ¶
type Stmt ¶
type Stmt struct {
// contains filtered or unexported fields
}
func (*Stmt) CheckNamedValue ¶
func (s *Stmt) CheckNamedValue(nv *driver.NamedValue) error
func (*Stmt) ExecContext ¶
func (*Stmt) QueryContext ¶
type ThreadSafeMap ¶
type ThreadSafeMap[K comparable, V any] struct { // contains filtered or unexported fields }
ThreadSafeMap provides a thread-safe map implementation using generics
func NewThreadSafeMap ¶
func NewThreadSafeMap[K comparable, V any]() *ThreadSafeMap[K, V]
NewThreadSafeMap creates a new thread-safe map
func (*ThreadSafeMap[K, V]) Clear ¶
func (tm *ThreadSafeMap[K, V]) Clear()
Clear removes all entries from the map
func (*ThreadSafeMap[K, V]) CompareAndDelete ¶
func (tm *ThreadSafeMap[K, V]) CompareAndDelete(key K, old V) (deleted bool)
CompareAndDelete deletes the entry for key if its value is equal to old
func (*ThreadSafeMap[K, V]) CompareAndSwap ¶
func (tm *ThreadSafeMap[K, V]) CompareAndSwap(key K, old, new V) bool
CompareAndSwap swaps the old and new values for key if the value stored in the map is equal to old
func (*ThreadSafeMap[K, V]) Delete ¶
func (tm *ThreadSafeMap[K, V]) Delete(key K)
Delete deletes the value for a key
func (*ThreadSafeMap[K, V]) Iter ¶
func (tm *ThreadSafeMap[K, V]) Iter() iter.Seq2[K, V]
Iter returns an iterator over key-value pairs in the map
func (*ThreadSafeMap[K, V]) Keys ¶
func (tm *ThreadSafeMap[K, V]) Keys() iter.Seq[K]
Keys returns an iterator over keys in the map
func (*ThreadSafeMap[K, V]) Len ¶
func (tm *ThreadSafeMap[K, V]) Len() int
Len returns the number of elements in the map Note: This is an O(n) operation as it needs to iterate through all elements
func (*ThreadSafeMap[K, V]) Load ¶
func (tm *ThreadSafeMap[K, V]) Load(key K) (value V, ok bool)
Load returns the value stored in the map for a key, or zero value if no value is present
func (*ThreadSafeMap[K, V]) LoadAndDelete ¶
func (tm *ThreadSafeMap[K, V]) LoadAndDelete(key K) (value V, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any
func (*ThreadSafeMap[K, V]) LoadOrStore ¶
func (tm *ThreadSafeMap[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
LoadOrStore returns the existing value for the key if present Otherwise, it stores and returns the given value
func (*ThreadSafeMap[K, V]) Store ¶
func (tm *ThreadSafeMap[K, V]) Store(key K, value V)
Store sets the value for a key
func (*ThreadSafeMap[K, V]) Swap ¶
func (tm *ThreadSafeMap[K, V]) Swap(key K, value V) (previous V, loaded bool)
Swap swaps the value for a key and returns the previous value if any
func (*ThreadSafeMap[K, V]) Values ¶
func (tm *ThreadSafeMap[K, V]) Values() iter.Seq[V]
Values returns an iterator over values in the map