Skip to content

Glossary ​

The words these pages use, each in one sense.

TermMeaning
AdapterThe object that connects a repo to one database through its driver: postgres(…), sqlite(…), mysql(…). It owns the connection pool and the plan cache. See Adapters.
AssociationA connection between two schemas, declared as a static member: belongsTo, hasOne, hasMany, manyToMany, or a chain with through. Other libraries call these relations. See Associations.
BatchA list of named steps that runs in one transaction, built with createBatch(). See Batch.
BindingThe name a table has inside a query (u in from(User, "u")), and the object of its columns that clause callbacks receive (({ u }) => u.email). See Bindings.
CapabilitySomething an adapter's database can or cannot do, such as fullJoin. A query that needs a missing one throws QueryError. See Dialect support.
ChangesetAn immutable description of a change to one record: the permitted input, converted, the changes, the validation errors, and the constraints to expect. See Changesets.
Changeset functionA function, usually a static method such as User.changeset, that builds the changeset for one form.
Constraint declarationA call such as uniqueConstraint("email") on a changeset, which turns that database violation into a field error. See Constraints.
Database schemaA namespace of tables in the database (a Postgres schema, a MySQL database), chosen with the schema option. Not to be confused with a schema class.
DialectOne of the databases the library writes SQL for: postgres, sqlite or mysql.
EmbedA structured value stored in one JSON column of its parent, declared with t.embedOne or t.embedMany and an EmbeddedSchema. See Embeds.
ExpressionA typed piece of SQL inside a query: a column, a value, an operator applied to them (u.age.gte(18)). See Expressions.
FieldOne property of a schema, declared with a type from t (email: t.string()), stored in a column.
FragmentRaw SQL written with the fragment tagged template; its interpolations are bound parameters.
MigrationA versioned change to the database's structure, written by hand. See Migrations.
Named parameterA placeholder in a query, param("minAge", t.integer()), given a value when the query runs.
PlanThe compiled form of a query: SQL text, slots for its values, and how to build the result. Cached per query shape. See How a query becomes SQL.
PreloadLoading the associated rows of a query's rows, with .preload("posts") or repo.preload(…). Nothing is loaded lazily. See Preloading.
QueryAn immutable value that describes a read or a bulk write, started with from(Schema, alias). Building it runs nothing. See Queries.
QueryableWhat the repo's read methods accept: a schema class (every row) or a query.
RepoThe object that runs queries and writes changesets, created with createRepo({ adapter }). tx, in a transaction, is a repo too. See Repo.
ResultWhat a write returns: { success: true, data } or { success: false, error }.
RowAn instance of a schema class, as the database returned it. Rows come only from the database; there is no public constructor.
SandboxThe test helper that runs each test in a transaction that is rolled back. See Testing.
Schema, schema classA class made with class User extends Schema("users", { … }) {} that describes a table. "Model" in other libraries.