Documentation
¶
Index ¶
- type Column
- func (c *Column[T]) AutoIncrement() *Column[T]
- func (c *Column[T]) Default(val T) *Column[T]
- func (c *Column[T]) ForeignKey(table, column string) *Column[T]
- func (c *Column[T]) FullName() string
- func (c *Column[T]) Name() string
- func (c *Column[T]) NotNull() *Column[T]
- func (c *Column[T]) Options() ColumnOptions
- func (c *Column[T]) PrimaryKey() *Column[T]
- func (c *Column[T]) SQLString() (string, bool)
- func (c *Column[T]) TableName() string
- func (c *Column[T]) Unique() *Column[T]
- func (c *Column[T]) Value() interface{}
- type ColumnOptions
- type ColumnRef
- type ForeignKeyRef
- type Table
- type TableInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Column ¶
type Column[T any] struct { // contains filtered or unexported fields }
Column represents a database column with type safety
func (*Column[T]) AutoIncrement ¶
AutoIncrement marks this column as auto-incrementing
func (*Column[T]) ForeignKey ¶
ForeignKey sets a foreign key reference
func (*Column[T]) Options ¶
func (c *Column[T]) Options() ColumnOptions
Options returns the column options
func (*Column[T]) PrimaryKey ¶
PrimaryKey marks this column as a primary key
func (*Column[T]) SQLString ¶ added in v2.0.9
SQLString implements the SQLValue interface for Column Returns the column name and false (not a literal value)
type ColumnOptions ¶
type ColumnOptions struct {
PrimaryKey bool
NotNull bool
Unique bool
AutoIncr bool
DefaultVal interface{}
ForeignKey *ForeignKeyRef
}
ColumnOptions holds column metadata
type ColumnRef ¶
type ColumnRef struct {
Name string
FullName string
Type reflect.Type
Options ColumnOptions
}
ColumnRef holds metadata about a column without type parameters
type ForeignKeyRef ¶
ForeignKeyRef represents a foreign key relationship
type Table ¶
type Table[T any] struct { C T // Column accessor (holds column definitions) // contains filtered or unexported fields }
Table represents a database table with typed columns
func (*Table[T]) ColumnNames ¶
ColumnNames returns all column names
type TableInterface ¶ added in v2.0.7
TableInterface is the interface that all table types must implement. It provides the table name for use in SQL queries.