Documentation ¶
Index ¶
- Constants
- Variables
- func Add(to Entity, items ...Entity) error
- func Delete(obj Entity) error
- func ExecRaw[E Entity](q string, args ...interface{}) (int64, int64, error)
- func Find[T Entity](id interface{}) (T, error)
- func GetConnection(name string) *connection
- func Insert(o Entity) error
- func InsertAll(objs ...Entity) error
- func QueryRaw[OUTPUT Entity](q string, args ...interface{}) ([]OUTPUT, error)
- func Raw(sql string, args ...interface{}) *raw
- func Save(obj Entity) error
- func Schematic()
- func SetupConnections(configs ...ConnectionConfig) error
- func Update(obj Entity) error
- type BelongsToConfig
- type BelongsToManyConfig
- type ConnectionConfig
- type Dialect
- type Entity
- type EntityConfigurator
- func (ec *EntityConfigurator) BelongsTo(owner Entity, config BelongsToConfig) *EntityConfigurator
- func (ec *EntityConfigurator) BelongsToMany(owner Entity, config BelongsToManyConfig) *EntityConfigurator
- func (ec *EntityConfigurator) Connection(name string) *EntityConfigurator
- func (ec *EntityConfigurator) Field(name string) *FieldConfigurator
- func (ec *EntityConfigurator) HasMany(property Entity, config HasManyConfig) *EntityConfigurator
- func (ec *EntityConfigurator) HasOne(property Entity, config HasOneConfig) *EntityConfigurator
- func (ec *EntityConfigurator) Table(name string) *EntityConfigurator
- type FieldConfigurator
- func (fc *FieldConfigurator) ColumnName(name string) *FieldConfigurator
- func (fc *FieldConfigurator) IsCreatedAt() *FieldConfigurator
- func (fc *FieldConfigurator) IsDeletedAt() *FieldConfigurator
- func (fc *FieldConfigurator) IsPrimaryKey() *FieldConfigurator
- func (fc *FieldConfigurator) IsUpdatedAt() *FieldConfigurator
- type GroupBy
- type HasManyConfig
- type HasOneConfig
- type Join
- type JoinOn
- type Limit
- type Offset
- type QueryBuilder
- func BelongsTo[OWNER Entity](property Entity) *QueryBuilder[OWNER]
- func BelongsToMany[OWNER Entity](property Entity) *QueryBuilder[OWNER]
- func HasMany[PROPERTY Entity](owner Entity) *QueryBuilder[PROPERTY]
- func HasOne[PROPERTY Entity](owner Entity) *QueryBuilder[PROPERTY]
- func NewQueryBuilder[OUTPUT any](s *schema) *QueryBuilder[OUTPUT]
- func Query[E Entity]() *QueryBuilder[E]
- func (q *QueryBuilder[OUTPUT]) All() ([]OUTPUT, error)
- func (q *QueryBuilder[OUTPUT]) AndWhere(parts ...interface{}) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) Count() *QueryBuilder[int]
- func (q *QueryBuilder[OUTPUT]) Delete() (rowsAffected int64, err error)
- func (q *QueryBuilder[OUTPUT]) First() *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) FromQuery(subQuery *QueryBuilder[OUTPUT]) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) FullOuterJoin(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) Get() (OUTPUT, error)
- func (q *QueryBuilder[OUTPUT]) GroupBy(columns ...string) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) InnerJoin(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) Join(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) Latest() *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) LeftJoin(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) Limit(n int) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) Offset(n int) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) OrWhere(parts ...interface{}) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) OrderBy(column string, how string) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) RightJoin(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) Select(columns ...string) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) Set(keyValues ...any) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) SetDelete() *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) SetDialect(dialect *Dialect) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) SetSelect() *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) SetUpdate() *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) Table(t string) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) ToSql() (string, []interface{}, error)
- func (q *QueryBuilder[OUTPUT]) Update() (rowsAffected int64, err error)
- func (q *QueryBuilder[OUTPUT]) Where(parts ...interface{}) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) WhereIn(column string, values ...interface{}) *QueryBuilder[OUTPUT]
- func (q *QueryBuilder[OUTPUT]) WherePK(value interface{}) *QueryBuilder[OUTPUT]
- type Timestamps
Constants ¶
const ( ASC = "ASC" DESC = "DESC" )
const ( JoinTypeInner = "INNER" JoinTypeLeft = "LEFT" JoinTypeRight = "RIGHT" JoinTypeFull = "FULL OUTER" JoinTypeSelf = "SELF" )
const ( Eq = "=" GT = ">" LT = "<" GE = ">=" LE = "<=" NE = "!=" Between = "BETWEEN" Like = "LIKE" In = "IN" )
Variables ¶
var Dialects = &struct { MySQL *Dialect PostgreSQL *Dialect SQLite3 *Dialect }{ MySQL: &Dialect{ DriverName: "mysql", PlaceholderChar: "?", IncludeIndexInPlaceholder: false, AddTableNameInSelectColumns: true, PlaceHolderGenerator: questionMarks, QueryListTables: "SHOW TABLES", QueryTableSchema: "DESCRIBE %s", }, PostgreSQL: &Dialect{ DriverName: "postgres", PlaceholderChar: "$", IncludeIndexInPlaceholder: true, AddTableNameInSelectColumns: true, PlaceHolderGenerator: postgresPlaceholder, QueryListTables: `\dt`, QueryTableSchema: `\d %s`, }, SQLite3: &Dialect{ DriverName: "sqlite3", PlaceholderChar: "?", IncludeIndexInPlaceholder: false, AddTableNameInSelectColumns: false, PlaceHolderGenerator: questionMarks, QueryListTables: "SELECT name FROM sqlite_schema WHERE type='table'", QueryTableSchema: `SELECT name,type,"notnull","dflt_value","pk" FROM PRAGMA_TABLE_INFO('%s')`, }, }
Functions ¶
func Add ¶ added in v1.2.0
Add adds `items` to `to` using relations defined between items and to in ConfigureEntity method of `to`.
func ExecRaw ¶ added in v1.2.0
ExecRaw executes given query string and arguments on given type parameter database connection.
func Find ¶ added in v1.2.0
Find finds the Entity you want based on generic type and primary key you passed.
func GetConnection ¶ added in v1.2.0
func GetConnection(name string) *connection
func Insert ¶ added in v1.2.0
Insert given entity into database based on their ConfigureEntity we can find table and also DB name.
func InsertAll ¶ added in v1.2.3
InsertAll given entities into database based on their ConfigureEntity we can find table and also DB name.
func QueryRaw ¶ added in v1.2.0
QueryRaw queries given query string and arguments on given type parameter database connection.
func Raw ¶ added in v1.2.0
func Raw(sql string, args ...interface{}) *raw
Raw creates a Raw sql query chunk that you can add to several components of QueryBuilder like Wheres.
func Save ¶ added in v1.2.0
Save saves given entity, if primary key is set we will make an update query and if primary key is zero value we will insert it.
func Schematic ¶ added in v1.2.0
func Schematic()
Schematic prints all information ORM inferred from your entities in startup, remember to pass your entities in Entities when you call SetupConnections if you want their data inferred otherwise Schematic does not print correct data since GoLobby ORM also incrementally cache your entities metadata and schema.
func SetupConnections ¶ added in v1.2.1
func SetupConnections(configs ...ConnectionConfig) error
SetupConnections declares a new connections for ORM.
Types ¶
type BelongsToConfig ¶ added in v1.2.0
type BelongsToConfig struct { // OwnerTable is the table that contains owner of a BelongsTo // relationship. OwnerTable string // LocalForeignKey is name of the field that links property // to its owner in BelongsTo relation. for example when // a Comment BelongsTo Post, LocalForeignKey is // post_id of Comment. LocalForeignKey string // ForeignColumnName is name of the field that LocalForeignKey // field value will point to it, for example when // a Comment BelongsTo Post, ForeignColumnName is // id of Post. ForeignColumnName string }
BelongsToConfig contains all information we need for a BelongsTo relationship BelongsTo is a relationship between a Comment and it's Post, A Comment BelongsTo Post.
type BelongsToManyConfig ¶ added in v1.2.0
type BelongsToManyConfig struct { // IntermediateTable is the name of the middle table // in a BelongsToMany (Many to Many) relationship. // for example when we have Post BelongsToMany // Category, this table will be post_categories // table, remember that this field cannot be // inferred. IntermediateTable string // IntermediatePropertyID is the name of the field name // of property foreign key in intermediate table, // for example when we have Post BelongsToMany // Category, in post_categories table, it would // be post_id. IntermediatePropertyID string // IntermediateOwnerID is the name of the field name // of property foreign key in intermediate table, // for example when we have Post BelongsToMany // Category, in post_categories table, it would // be category_id. IntermediateOwnerID string // Table name of the owner in BelongsToMany relation, // for example in Post BelongsToMany Category // Owner table is name of Category table // for example `categories`. OwnerTable string // OwnerLookupColumn is name of the field in the owner // table that is used in query, for example in Post BelongsToMany Category // Owner lookup field would be Category primary key which is id. OwnerLookupColumn string }
BelongsToManyConfig contains information that we need for creating many to many queries.
type ConnectionConfig ¶ added in v1.2.0
type ConnectionConfig struct { // Name of your database connection, it's up to you to name them anything // just remember that having a connection name is mandatory if // you have multiple connections Name string // If you already have an active database connection configured pass it in this value and // do not pass Driver and DSN fields. DB *sql.DB // Which dialect of sql to generate queries for, you don't need it most of the times when you are using // traditional databases such as mysql, sqlite3, postgres. Dialect *Dialect // List of entities that you want to use for this connection, remember that you can ignore this field // and GoLobby ORM will build our metadata cache incrementally but you will lose schematic // information that we can provide you and also potentialy validations that we // can do with the database Entities []Entity // Database validations, check if all tables exists and also table schemas contains all necessary columns. // Check if all infered tables exist in your database DatabaseValidations bool }
type Entity ¶
type Entity interface { // ConfigureEntity should be defined for all of your database entities // and it can define Table, DB and also relations of your Entity. ConfigureEntity(e *EntityConfigurator) }
Entity defines the interface that each of your structs that you want to use as database entities should have, it's a simple one and its ConfigureEntity.
type EntityConfigurator ¶ added in v1.2.0
type EntityConfigurator struct {
// contains filtered or unexported fields
}
func (*EntityConfigurator) BelongsTo ¶ added in v1.2.0
func (ec *EntityConfigurator) BelongsTo(owner Entity, config BelongsToConfig) *EntityConfigurator
func (*EntityConfigurator) BelongsToMany ¶ added in v1.2.0
func (ec *EntityConfigurator) BelongsToMany(owner Entity, config BelongsToManyConfig) *EntityConfigurator
func (*EntityConfigurator) Connection ¶ added in v1.2.0
func (ec *EntityConfigurator) Connection(name string) *EntityConfigurator
func (*EntityConfigurator) Field ¶ added in v1.2.2
func (ec *EntityConfigurator) Field(name string) *FieldConfigurator
func (*EntityConfigurator) HasMany ¶ added in v1.2.0
func (ec *EntityConfigurator) HasMany(property Entity, config HasManyConfig) *EntityConfigurator
func (*EntityConfigurator) HasOne ¶ added in v1.2.0
func (ec *EntityConfigurator) HasOne(property Entity, config HasOneConfig) *EntityConfigurator
func (*EntityConfigurator) Table ¶ added in v1.2.0
func (ec *EntityConfigurator) Table(name string) *EntityConfigurator
type FieldConfigurator ¶ added in v1.2.0
type FieldConfigurator struct {
// contains filtered or unexported fields
}
func (*FieldConfigurator) ColumnName ¶ added in v1.2.0
func (fc *FieldConfigurator) ColumnName(name string) *FieldConfigurator
func (*FieldConfigurator) IsCreatedAt ¶ added in v1.2.0
func (fc *FieldConfigurator) IsCreatedAt() *FieldConfigurator
func (*FieldConfigurator) IsDeletedAt ¶ added in v1.2.0
func (fc *FieldConfigurator) IsDeletedAt() *FieldConfigurator
func (*FieldConfigurator) IsPrimaryKey ¶ added in v1.2.0
func (fc *FieldConfigurator) IsPrimaryKey() *FieldConfigurator
func (*FieldConfigurator) IsUpdatedAt ¶ added in v1.2.0
func (fc *FieldConfigurator) IsUpdatedAt() *FieldConfigurator
type HasManyConfig ¶ added in v1.2.0
type HasManyConfig struct { // PropertyTable is table of the property of HasMany relationship, // consider `Comment` in Post and Comment relationship, // each Post HasMany Comment, so PropertyTable is // `comments`. PropertyTable string // PropertyForeignKey is the foreign key field name in the property table, // for example in Post HasMany Comment, if comment has `post_id` field, // it's the PropertyForeignKey field. PropertyForeignKey string }
HasManyConfig contains all information we need for querying HasMany relationships. We can infer both fields if you have them in standard way but you can specify them if you want custom ones.
type HasOneConfig ¶ added in v1.2.0
type HasOneConfig struct { // PropertyTable is table of the property of HasOne relationship, // consider `HeaderPicture` in Post and HeaderPicture relationship, // each Post HasOne HeaderPicture, so PropertyTable is // `header_pictures`. PropertyTable string // PropertyForeignKey is the foreign key field name in the property table, // forexample in Post HasOne HeaderPicture, if header_picture has `post_id` field, // it's the PropertyForeignKey field. PropertyForeignKey string }
HasOneConfig contains all information we need for a HasOne relationship, it's similar to HasManyConfig.
type QueryBuilder ¶ added in v1.2.0
type QueryBuilder[OUTPUT any] struct { // contains filtered or unexported fields }
QueryBuilder is our query builder, almost all methods and functions in GoLobby ORM create or configure instance of QueryBuilder.
func BelongsTo ¶ added in v1.2.0
func BelongsTo[OWNER Entity](property Entity) *QueryBuilder[OWNER]
BelongsTo configures a QueryBuilder for a BelongsTo relationship between OWNER type parameter and property argument, so property BelongsTo OWNER.
func BelongsToMany ¶ added in v1.2.0
func BelongsToMany[OWNER Entity](property Entity) *QueryBuilder[OWNER]
BelongsToMany configures a QueryBuilder for a BelongsToMany relationship
func HasMany ¶ added in v1.2.0
func HasMany[PROPERTY Entity](owner Entity) *QueryBuilder[PROPERTY]
HasMany configures a QueryBuilder for a HasMany relationship this relationship will be defined for owner argument that has many of PROPERTY generic type for example HasMany[Comment](&Post{}) is for Post HasMany Comment relationship.
func HasOne ¶ added in v1.2.0
func HasOne[PROPERTY Entity](owner Entity) *QueryBuilder[PROPERTY]
HasOne configures a QueryBuilder for a HasOne relationship this relationship will be defined for owner argument that has one of PROPERTY generic type for example HasOne[HeaderPicture](&Post{}) is for Post HasOne HeaderPicture relationship.
func NewQueryBuilder ¶ added in v1.2.0
func NewQueryBuilder[OUTPUT any](s *schema) *QueryBuilder[OUTPUT]
func Query ¶ added in v1.2.0
func Query[E Entity]() *QueryBuilder[E]
Query creates a new QueryBuilder for given type parameter, sets dialect and table as well.
func (*QueryBuilder[OUTPUT]) All ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) All() ([]OUTPUT, error)
All is a finisher, create the Select query based on QueryBuilder and scan results into slice of type parameter E.
func (*QueryBuilder[OUTPUT]) AndWhere ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) AndWhere(parts ...interface{}) *QueryBuilder[OUTPUT]
AndWhere appends a where clause to query builder as And where clause.
func (*QueryBuilder[OUTPUT]) Count ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Count() *QueryBuilder[int]
Count creates and execute a select query from QueryBuilder and set it's field list of selection to COUNT(id).
func (*QueryBuilder[OUTPUT]) Delete ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Delete() (rowsAffected int64, err error)
Delete is a finisher, creates a delete query from query builder and executes it.
func (*QueryBuilder[OUTPUT]) First ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) First() *QueryBuilder[OUTPUT]
First returns first record of database using OrderBy primary key ascending order.
func (*QueryBuilder[OUTPUT]) FromQuery ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) FromQuery(subQuery *QueryBuilder[OUTPUT]) *QueryBuilder[OUTPUT]
FromQuery sets subquery of QueryBuilder to be given subquery so when doing select instead of from table we do from(subquery).
func (*QueryBuilder[OUTPUT]) FullOuterJoin ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) FullOuterJoin(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
FullOuterJoin adds a full outer join section to QueryBuilder.
func (*QueryBuilder[OUTPUT]) Get ¶ added in v1.2.1
func (q *QueryBuilder[OUTPUT]) Get() (OUTPUT, error)
Get limit results to 1, runs query generated by query builder, scans result into OUTPUT.
func (*QueryBuilder[OUTPUT]) GroupBy ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) GroupBy(columns ...string) *QueryBuilder[OUTPUT]
GroupBy adds a group by section to QueryBuilder.
func (*QueryBuilder[OUTPUT]) InnerJoin ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) InnerJoin(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
InnerJoin adds a inner join section to QueryBuilder.
func (*QueryBuilder[OUTPUT]) Join ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Join(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
Join adds a inner join section to QueryBuilder.
func (*QueryBuilder[OUTPUT]) Latest ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Latest() *QueryBuilder[OUTPUT]
Latest is like Get but it also do a OrderBy(primary key, DESC)
func (*QueryBuilder[OUTPUT]) LeftJoin ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) LeftJoin(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
LeftJoin adds a left join section to QueryBuilder.
func (*QueryBuilder[OUTPUT]) Limit ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Limit(n int) *QueryBuilder[OUTPUT]
Limit adds limit section to query builder.
func (*QueryBuilder[OUTPUT]) Offset ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Offset(n int) *QueryBuilder[OUTPUT]
Offset adds offset section to query builder.
func (*QueryBuilder[OUTPUT]) OrWhere ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) OrWhere(parts ...interface{}) *QueryBuilder[OUTPUT]
OrWhere appends a where clause to query builder as Or where clause.
func (*QueryBuilder[OUTPUT]) OrderBy ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) OrderBy(column string, how string) *QueryBuilder[OUTPUT]
OrderBy adds an OrderBy section to QueryBuilder.
func (*QueryBuilder[OUTPUT]) RightJoin ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) RightJoin(table string, onLhs string, onRhs string) *QueryBuilder[OUTPUT]
RightJoin adds a right join section to QueryBuilder.
func (*QueryBuilder[OUTPUT]) Select ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Select(columns ...string) *QueryBuilder[OUTPUT]
Select adds columns to QueryBuilder select field list.
func (*QueryBuilder[OUTPUT]) Set ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Set(keyValues ...any) *QueryBuilder[OUTPUT]
func (*QueryBuilder[OUTPUT]) SetDelete ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) SetDelete() *QueryBuilder[OUTPUT]
func (*QueryBuilder[OUTPUT]) SetDialect ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) SetDialect(dialect *Dialect) *QueryBuilder[OUTPUT]
func (*QueryBuilder[OUTPUT]) SetSelect ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) SetSelect() *QueryBuilder[OUTPUT]
SetSelect sets query type of QueryBuilder to Select.
func (*QueryBuilder[OUTPUT]) SetUpdate ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) SetUpdate() *QueryBuilder[OUTPUT]
func (*QueryBuilder[OUTPUT]) Table ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Table(t string) *QueryBuilder[OUTPUT]
Table sets table of QueryBuilder.
func (*QueryBuilder[OUTPUT]) ToSql ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) ToSql() (string, []interface{}, error)
ToSql creates sql query from QueryBuilder based on internal fields it would decide what kind of query to build.
func (*QueryBuilder[OUTPUT]) Update ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Update() (rowsAffected int64, err error)
Update is a finisher, creates an Update query from QueryBuilder and executes in into database, returns
func (*QueryBuilder[OUTPUT]) Where ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) Where(parts ...interface{}) *QueryBuilder[OUTPUT]
Where Adds a where clause to query, if already have where clause append to it as AndWhere.
func (*QueryBuilder[OUTPUT]) WhereIn ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) WhereIn(column string, values ...interface{}) *QueryBuilder[OUTPUT]
WhereIn adds a where clause to QueryBuilder using In operator.
func (*QueryBuilder[OUTPUT]) WherePK ¶ added in v1.2.0
func (q *QueryBuilder[OUTPUT]) WherePK(value interface{}) *QueryBuilder[OUTPUT]
WherePK adds a where clause to QueryBuilder and also gets primary key name from type parameter schema.