Documentation ¶
Index ¶
- Variables
- func AlterTable(db fdb.Transactor, dbName string, ast *AstAlterTable, user ...*User) (err error)
- func BatchInsert(db fdb.Transactor, stmt *insertStmt, argsArray [][]interface{}) (err error)
- func CreateAdj(db fdb.Transactor, dbName string) (err error)
- func CreateDatabase(db fdb.Transactor, dbName string) (err error)
- func CreateTable(db fdb.Transactor, dbName string, ast *AstCreateTable) (err error)
- func DropDatabase(db fdb.Transactor, dbName string) (err error)
- func DropTable(db fdb.Transactor, dbName string, tblName string) (err error)
- func Execute(db fdb.Transactor, dbName string, sql string, args []interface{}, ...) (res [][]interface{}, err error)
- func ExecuteStmt(db fdb.Transactor, stmt interface{}, args []interface{}) (res [][]interface{}, err error)
- func HasDatabase(db fdb.Transactor, dbName string) (bool, error)
- func HasTable(db fdb.Transactor, dbName string, tblName string) (bool, error)
- func ListDatabases(db fdb.Transactor) (dbNames []string, err error)
- func ListTables(db fdb.Transactor, dbName string) (tables []string, err error)
- func LoadUsers(db fdb.Transactor) (err error)
- func RenameTable(db fdb.Transactor, tbl *TableSchema, colOldNewName []string, ...) (err error)
- func Resolve(db fdb.Transactor, dbName string, ast *Ast, user ...*User) (stmt interface{}, err error)
- func StartServer(addr string, fdbClusterFile string, ...) error
- type Ast
- type AstAlterTable
- type AstAlterTableType
- type AstBoolean
- type AstCondition
- type AstCreate
- type AstCreateDatabase
- type AstCreateTable
- type AstDelete
- type AstDrop
- type AstExpression
- type AstInsert
- type AstNumber
- type AstRename
- type AstSelect
- type AstSelectCol
- type AstSelectExpression
- type AstSelectFunc
- type AstTableName
- type AstTypeDef
- type AstValue
- type DataType
- type PermType
- type TableColDef
- type TableSchema
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var FdbVersion = 520
View Source
var TableSchemaMap = sync.Map{}
Functions ¶
func AlterTable ¶
func AlterTable(db fdb.Transactor, dbName string, ast *AstAlterTable, user ...*User) (err error)
func BatchInsert ¶
func BatchInsert(db fdb.Transactor, stmt *insertStmt, argsArray [][]interface{}) (err error)
func CreateDatabase ¶
func CreateDatabase(db fdb.Transactor, dbName string) (err error)
func CreateTable ¶
func CreateTable(db fdb.Transactor, dbName string, ast *AstCreateTable) (err error)
func DropDatabase ¶
func DropDatabase(db fdb.Transactor, dbName string) (err error)
func ExecuteStmt ¶
func ExecuteStmt(db fdb.Transactor, stmt interface{}, args []interface{}) (res [][]interface{}, err error)
func HasDatabase ¶
func HasDatabase(db fdb.Transactor, dbName string) (bool, error)
func ListDatabases ¶
func ListDatabases(db fdb.Transactor) (dbNames []string, err error)
func ListTables ¶
func ListTables(db fdb.Transactor, dbName string) (tables []string, err error)
func LoadUsers ¶
func LoadUsers(db fdb.Transactor) (err error)
func RenameTable ¶
func RenameTable(db fdb.Transactor, tbl *TableSchema, colOldNewName []string, newTableName *string) (err error)
Types ¶
type Ast ¶
type AstAlterTable ¶
type AstAlterTable struct { Table *AstTableName `@@` AlterTableType *AstAlterTableType `@@` }
type AstAlterTableType ¶
type AstAlterTableType struct {
Rename *AstRename `"RENAME" @@`
}
type AstBoolean ¶
type AstBoolean bool
func (*AstBoolean) Capture ¶
func (self *AstBoolean) Capture(values []string) error
type AstCondition ¶
type AstCreate ¶
type AstCreate struct { Table *AstCreateTable `"TABLE" @@` Database *AstCreateDatabase `| "DATABASE" @@` }
type AstCreateDatabase ¶
type AstCreateTable ¶
type AstCreateTable struct { IfNotExists *string `[@("IF" "NOT" "EXISTS")]` Name *AstTableName `@@` Cols []AstTypeDef `"(" @@ {"," @@} ")"` }
type AstDelete ¶
type AstDelete struct { Table *AstTableName `"FROM" @@` Where *AstExpression `["WHERE" @@]` }
type AstDrop ¶
type AstDrop struct { Table *AstTableName `"TABLE" @@` Database *string `| "DATABASE" @Ident` }
type AstExpression ¶
type AstExpression struct {
And []AstCondition `@@ {"AND" @@}`
}
type AstInsert ¶
type AstInsert struct { Table *AstTableName `"INTO" @@` Cols []string `["(" @Ident {"," @Ident} ")"]` Values []AstValue `"VALUES" "(" @@ {"," @@} ")"` }
type AstSelect ¶
type AstSelect struct { Selected *AstSelectExpression `@@` Table *AstTableName `"FROM" @@` Where *AstExpression `["WHERE" @@]` Limit *int64 `["LIMIT" @Number]` }
type AstSelectCol ¶
type AstSelectCol struct { Name *string `@Ident` Func *AstSelectFunc `| @@` }
type AstSelectExpression ¶
type AstSelectExpression struct { All *string `@"*"` Cols []AstSelectCol `| @@ {"," @@}` }
type AstSelectFunc ¶
type AstTableName ¶
func (*AstTableName) DatabaseName ¶
func (self *AstTableName) DatabaseName() string
func (*AstTableName) TableName ¶
func (self *AstTableName) TableName() string
type AstTypeDef ¶
type AstValue ¶
type AstValue struct { Number *AstNumber `@Number` String *string `| @String` Placeholder *string `| @"?"` Boolean *AstBoolean `| @("TRUE" | "FALSE")` }
type TableColDef ¶
type TableColDef struct { Name string Type DataType IsKey bool PosCol uint32 Pos uint32 // position in Key or Values }
func NewTableColDef ¶
func NewTableColDef(name string, t DataType) (tbl *TableColDef)
type TableSchema ¶
type TableSchema struct { DbName string TblName string Cols []*TableColDef Keys []*TableColDef Values []*TableColDef NameMap map[string]*TableColDef Dir directory.DirectorySubspace }
func GetTableSchema ¶
func GetTableSchema(db fdb.Transactor, dbName string, tblName string) (tbl *TableSchema, err error)
func NewTableSchema ¶
func NewTableSchema(cols []*TableColDef, keys []int) (tbl TableSchema)
type User ¶
type User struct {
// contains filtered or unexported fields
}
func (*User) CheckPassword ¶
func (User) UpdatePasswd ¶
func (user User) UpdatePasswd(db fdb.Transactor, newpasswd string) error
Click to show internal directories.
Click to hide internal directories.