Documentation ¶
Index ¶
- func CurrentTime(ctx context.Context) *time.Time
- func TimeFromTimestampValue(v string) (time.Time, error)
- func WithCurrentTime(ctx context.Context, now time.Time) context.Context
- type ChangedCatalog
- type ChangedFunction
- type ChangedTable
- type ColumnSpec
- type ColumnType
- type FunctionSpec
- type NameWithType
- type TableSpec
- type Type
- type ZetaSQLiteConn
- func (c *ZetaSQLiteConn) AddNamePath(path string) error
- func (c *ZetaSQLiteConn) Begin() (driver.Tx, error)
- func (c *ZetaSQLiteConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error)
- func (s *ZetaSQLiteConn) CheckNamedValue(value *driver.NamedValue) error
- func (c *ZetaSQLiteConn) Close() error
- func (c *ZetaSQLiteConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (r driver.Result, e error)
- func (c *ZetaSQLiteConn) MaxNamePath() int
- func (c *ZetaSQLiteConn) NamePath() []string
- func (c *ZetaSQLiteConn) Prepare(query string) (driver.Stmt, error)
- func (c *ZetaSQLiteConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (r driver.Rows, e error)
- func (c *ZetaSQLiteConn) SetAutoIndexMode(enabled bool)
- func (c *ZetaSQLiteConn) SetExplainMode(enabled bool)
- func (c *ZetaSQLiteConn) SetMaxNamePath(num int)
- func (c *ZetaSQLiteConn) SetNamePath(path []string) error
- type ZetaSQLiteDriver
- type ZetaSQLiteTx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentTime ¶
CurrentTime gets the time specified by WithCurrentTime.
func TimeFromTimestampValue ¶
TimeFromTimestampValue zetasqlite returns string values by default for timestamp values. This function is a helper function to convert that value to time.Time type.
func WithCurrentTime ¶
WithCurrentTime use to replace the current time with the specified time. To replace the time, you need to pass the returned context as an argument to QueryContext. `CURRENT_DATE`, `CURRENT_DATETIME`, `CURRENT_TIME`, `CURRENT_TIMESTAMP` functions are targeted.
Types ¶
type ChangedCatalog ¶
type ChangedCatalog = internal.ChangedCatalog
func ChangedCatalogFromResult ¶
func ChangedCatalogFromResult(result sql.Result) (*ChangedCatalog, error)
ChangedCatalogFromResult retrieve modified catalog information from sql.Result. NOTE: This API relies on the internal structure of sql.Result, so not will work for all Go versions.
func ChangedCatalogFromRows ¶
func ChangedCatalogFromRows(rows *sql.Rows) (*ChangedCatalog, error)
ChangedCatalogFromRows retrieve modified catalog information from sql.Rows. NOTE: This API relies on the internal structure of sql.Rows, so not will work for all Go versions.
type ChangedFunction ¶
type ChangedFunction = internal.ChangedFunction
type ChangedTable ¶
type ChangedTable = internal.ChangedTable
type ColumnSpec ¶
type ColumnSpec = internal.ColumnSpec
type ColumnType ¶
func UnmarshalDatabaseTypeName ¶
func UnmarshalDatabaseTypeName(typ string) (*ColumnType, error)
type FunctionSpec ¶
type FunctionSpec = internal.FunctionSpec
type NameWithType ¶
type NameWithType = internal.NameWithType
type ZetaSQLiteConn ¶
type ZetaSQLiteConn struct {
// contains filtered or unexported fields
}
func (*ZetaSQLiteConn) AddNamePath ¶
func (c *ZetaSQLiteConn) AddNamePath(path string) error
AddNamePath add path to name path to be set as prefix. If max name path is specified, an error is returned if the number is exceeded.
func (*ZetaSQLiteConn) CheckNamedValue ¶
func (s *ZetaSQLiteConn) CheckNamedValue(value *driver.NamedValue) error
func (*ZetaSQLiteConn) Close ¶
func (c *ZetaSQLiteConn) Close() error
func (*ZetaSQLiteConn) ExecContext ¶
func (c *ZetaSQLiteConn) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (r driver.Result, e error)
func (*ZetaSQLiteConn) MaxNamePath ¶
func (c *ZetaSQLiteConn) MaxNamePath() int
MaxNamePath returns maximum value of name path.
func (*ZetaSQLiteConn) NamePath ¶
func (c *ZetaSQLiteConn) NamePath() []string
NamePath returns path to name path to be set as prefix.
func (*ZetaSQLiteConn) Prepare ¶
func (c *ZetaSQLiteConn) Prepare(query string) (driver.Stmt, error)
func (*ZetaSQLiteConn) QueryContext ¶
func (c *ZetaSQLiteConn) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (r driver.Rows, e error)
func (*ZetaSQLiteConn) SetAutoIndexMode ¶
func (c *ZetaSQLiteConn) SetAutoIndexMode(enabled bool)
func (*ZetaSQLiteConn) SetExplainMode ¶
func (c *ZetaSQLiteConn) SetExplainMode(enabled bool)
func (*ZetaSQLiteConn) SetMaxNamePath ¶
func (c *ZetaSQLiteConn) SetMaxNamePath(num int)
SetMaxNamePath specifies the maximum value of name path. If the name path in the query is the maximum value, the name path set as prefix is not used. Effective only when a value greater than zero is specified ( default zero ).
func (*ZetaSQLiteConn) SetNamePath ¶
func (c *ZetaSQLiteConn) SetNamePath(path []string) error
SetNamePath set path to name path to be set as prefix. If max name path is specified, an error is returned if the number is exceeded.
type ZetaSQLiteDriver ¶
type ZetaSQLiteDriver struct {
ConnectHook func(*ZetaSQLiteConn) error
}
type ZetaSQLiteTx ¶
type ZetaSQLiteTx struct {
// contains filtered or unexported fields
}
func (*ZetaSQLiteTx) Commit ¶
func (tx *ZetaSQLiteTx) Commit() error
func (*ZetaSQLiteTx) Rollback ¶
func (tx *ZetaSQLiteTx) Rollback() error