Documentation
¶
Index ¶
- Constants
- Variables
- func IsValidUTF8Locale(setting string) bool
- type DBStats
- type Placeholder
- type Pool
- func (pgPool *Pool) CreateSchema(ctx context.Context, schema string) error
- func (pgPool *Pool) CreateTable(ctx context.Context, schema, table string) error
- func (pgPool *Pool) DropSchema(ctx context.Context, schema string) error
- func (pgPool *Pool) DropTable(ctx context.Context, schema, table string) error
- func (pgPool *Pool) SchemaStats(ctx context.Context, schema string) (*DBStats, error)
- func (pgPool *Pool) Schemas(ctx context.Context) ([]string, error)
- func (pgPool *Pool) TableStats(ctx context.Context, schema, table string) (*TableStats, error)
- func (pgPool *Pool) Tables(ctx context.Context, schema string) ([]string, []string, error)
- type TableStats
Constants ¶
const ( // Table uses JSONB1 storage. JSONB1Table = "jsonb1" // Table uses SQL storage. SQLTable = "sql" )
Variables ¶
var ( ErrNotExist = fmt.Errorf("schema or table does not exist") ErrAlreadyExist = fmt.Errorf("schema or table already exist") )
Functions ¶
func IsValidUTF8Locale ¶ added in v0.0.6
IsValidUTF8Locale Currently supported locale variants, compromised between https://www.postgresql.org/docs/9.3/multibyte.html and https://www.gnu.org/software/libc/manual/html_node/Locale-Names.html.
Valid examples: * en_US.utf8, * en_US.utf-8 * en_US.UTF8, * en_US.UTF-8.
Types ¶
type DBStats ¶ added in v0.0.6
type DBStats struct {
Name string
CountTables int32
CountRows int32
SizeTotal int64
SizeIndexes int64
SizeSchema int64
CountIndexes int32
}
DBStats describes some statistics for a database.
type Placeholder ¶
type Placeholder int
func (*Placeholder) Next ¶
func (p *Placeholder) Next() string
type Pool ¶
Pool data struct for *pgxpool.Pool.
func (*Pool) CreateSchema ¶ added in v0.0.5
CreateSchema creates a new FerretDB database / PostgreSQL schema.
It returns ErrAlreadyExist if schema already exist.
func (*Pool) CreateTable ¶ added in v0.0.5
CreateTable creates a new FerretDB collection / PostgreSQL jsonb1 table.
It returns ErrAlreadyExist if table already exist.
func (*Pool) DropSchema ¶ added in v0.0.5
DropSchema drops FerretDB database / PostgreSQL schema.
It returns ErrNotExist if schema does not exist.
func (*Pool) DropTable ¶ added in v0.0.5
DropTable drops FerretDB collection / PostgreSQL table.
It returns ErrNotExist is table does not exist.
func (*Pool) SchemaStats ¶ added in v0.0.6
SchemaStats returns a set of statistics for FerretDB database / PostgreSQL schema.
func (*Pool) Schemas ¶ added in v0.0.5
Schemas returns a sorted list of FerretDB database / PostgreSQL schema names.
func (*Pool) TableStats ¶ added in v0.0.5
TableStats returns a set of statistics for FerretDB collection / PostgreSQL table.