Documentation ¶
Index ¶
- type Column
- type DB
- type Enum
- type ForeignKey
- type Index
- type Repo
- func (r Repo) Get(ctx context.Context) (db.DB, error)
- func (r Repo) GetColumns(ctx context.Context) ([]*Column, error)
- func (r Repo) GetEnums(ctx context.Context) ([]*Enum, error)
- func (r Repo) GetForeignKeys(ctx context.Context) ([]*ForeignKey, error)
- func (r Repo) GetIndexes(ctx context.Context) ([]*Index, error)
- func (r Repo) GetTables(ctx context.Context) ([]*Table, error)
- func (r Repo) GetTypeNameByID(ctx context.Context, id int64) (string, error)
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column struct { Schema string `json:"schema,omitempty"` // postgres type: name Table string `json:"table,omitempty"` // postgres type: name Name string `json:"name,omitempty"` // postgres type: name Ordinal int16 `json:"ordinal,omitempty"` // postgres type: int2 Nullable bool `json:"nullable,omitempty"` // postgres type: bool HasDefault bool `json:"has_default,omitempty"` // postgres type: bool Type string `json:"type,omitempty"` // postgres type: name Comment string `json:"comment,omitempty"` // postgres type: text }
Column represents a result from 'GetColumns'.
type DB ¶
type DB interface { Exec(context.Context, string, ...any) (pgconn.CommandTag, error) Query(context.Context, string, ...any) (pgx.Rows, error) QueryRow(context.Context, string, ...any) pgx.Row }
DB is the common interface for database operations.
type Enum ¶
type Enum struct { ID uint32 `json:"id,omitempty"` // postgres type: oid Name string `json:"name,omitempty"` // postgres type: name Schema string `json:"schema,omitempty"` // postgres type: name Values []string `json:"values,omitempty"` // postgres type: _name Comment string `json:"comment,omitempty"` // postgres type: text }
Enum represents a result from 'GetEnums'.
type ForeignKey ¶
type ForeignKey struct { ID uint32 `json:"id,omitempty"` // postgres type: oid Schema string `json:"schema,omitempty"` // postgres type: name Name string `json:"name,omitempty"` // postgres type: name Table string `json:"table,omitempty"` // postgres type: name Columns []string `json:"columns,omitempty"` // postgres type: _name ForeignSchema string `json:"foreign_schema,omitempty"` // postgres type: name ForeignTable string `json:"foreign_table,omitempty"` // postgres type: name ForeignColumns []string `json:"foreign_columns,omitempty"` // postgres type: _name Comment string `json:"comment,omitempty"` // postgres type: text }
ForeignKey represents a result from 'GetForeignKeys'.
type Index ¶
type Index struct { ID uint32 `json:"id,omitempty"` // postgres type: oid Schema string `json:"schema,omitempty"` // postgres type: name Name string `json:"name,omitempty"` // postgres type: name Table string `json:"table,omitempty"` // postgres type: name IsUnique bool `json:"is_unique,omitempty"` // postgres type: bool IsPrimary bool `json:"is_primary,omitempty"` // postgres type: bool Columns []string `json:"columns,omitempty"` // postgres type: _name Comment string `json:"comment,omitempty"` // postgres type: text }
Index represents a result from 'GetIndexes'.
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
func (Repo) GetColumns ¶
GetColumns returns Column
func (Repo) GetForeignKeys ¶
func (r Repo) GetForeignKeys(ctx context.Context) ([]*ForeignKey, error)
GetForeignKeys returns ForeignKey
func (Repo) GetIndexes ¶
GetIndexes returns Index
type Table ¶
type Table struct { ID uint32 `json:"id,omitempty"` // postgres type: oid Schema string `json:"schema,omitempty"` // postgres type: name Name string `json:"name,omitempty"` // postgres type: name Type string `json:"type,omitempty"` // postgres type: text CanUpdate bool `json:"can_update,omitempty"` // postgres type: bool CanInsert bool `json:"can_insert,omitempty"` // postgres type: bool CanDelete bool `json:"can_delete,omitempty"` // postgres type: bool Comment string `json:"comment,omitempty"` // postgres type: text }
Table represents a result from 'GetTables'.
Click to show internal directories.
Click to hide internal directories.