Documentation ¶
Index ¶
- func InvalidColErr(colName, tblName string) error
- func InvalidTblErr(name string) error
- func InvalidTypeErr(column, typeName string) error
- func WithDb(handler DbHandler) http.HandlerFunc
- func WithPrimary(handler DbHandler) http.HandlerFunc
- type Column
- type Database
- func (dao Database) AlterTable(table string, body io.ReadCloser) error
- func (dao Database) CreateDb(body io.ReadCloser) error
- func (dao Database) CreateTable(table string, body io.ReadCloser) error
- func (dao Database) DeleteDb(name string) error
- func (dao Database) DeleteRows(table string, params url.Values) ([]byte, error)
- func (dao Database) DropTable(table string) error
- func (dao Database) EditSchema(body io.ReadCloser) error
- func (dao Database) InsertRows(table string, params url.Values, body io.ReadCloser, upsert bool) ([]byte, error)
- func (dao *Database) InvalidateSchema() error
- func (dao Database) ListDbs() ([]byte, error)
- func (dao Database) QueryDbInfo(dbName string) (int32, string, SchemaCache, error)
- func (dao Database) QueryJSON(query string, args ...any) ([]byte, error)
- func (dao Database) QueryMap(query string, args ...any) ([]interface{}, error)
- func (dao Database) RegisterDb(body io.ReadCloser, dbToken string) error
- func (dao Database) SelectRows(table string, params url.Values) ([]byte, error)
- func (dao Database) UpdateRows(table string, params url.Values, body io.ReadCloser) ([]byte, error)
- type DbHandler
- type Fk
- type NewColumn
- type Param
- type PkMap
- type Response
- type SchemaCache
- type Table
- type TblMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InvalidColErr ¶
func InvalidTblErr ¶
func InvalidTypeErr ¶
func WithDb ¶
func WithDb(handler DbHandler) http.HandlerFunc
for endpoints that can use either the primary or an external database
func WithPrimary ¶
func WithPrimary(handler DbHandler) http.HandlerFunc
for endpoints that only work with the primary database
Types ¶
type Database ¶
type Database struct { Client *sql.DB Schema SchemaCache // contains filtered or unexported fields }
func ConnPrimary ¶
func (Database) AlterTable ¶
func (dao Database) AlterTable(table string, body io.ReadCloser) error
func (Database) CreateDb ¶
func (dao Database) CreateDb(body io.ReadCloser) error
for use with the primary database
func (Database) CreateTable ¶
func (dao Database) CreateTable(table string, body io.ReadCloser) error
func (Database) DeleteRows ¶
func (Database) EditSchema ¶
func (dao Database) EditSchema(body io.ReadCloser) error
func (Database) InsertRows ¶
func (*Database) InvalidateSchema ¶
func (Database) QueryDbInfo ¶
func (Database) RegisterDb ¶
func (dao Database) RegisterDb(body io.ReadCloser, dbToken string) error
creates a schema cache and stores it for an already existing turso db
func (Database) SelectRows ¶
func (Database) UpdateRows ¶
type SchemaCache ¶
func QueryPrimaryInfo ¶
func QueryPrimaryInfo(db *sql.DB) (SchemaCache, error)
Click to show internal directories.
Click to hide internal directories.