OnCreateQuery class
An internal schema entity to run an sql statement when the database is created.
The generator uses this entity to implement @create
statements in drift
files:
CREATE TABLE users (name TEXT);
@create: INSERT INTO users VALUES ('Bob');
A OnCreateQuery is emitted for each @create
statement in an included
drift file.
- Inheritance
-
- Object
- DatabaseSchemaEntity
- OnCreateQuery
Constructors
- OnCreateQuery(String sql)
-
Create a query that will be run in the default
onCreate
migration. -
OnCreateQuery.byDialect(Map<
SqlDialect, String> sqlByDialect) -
Creates the entity of a query to run in the default
onCreate
migration.
Properties
- entityName → String
-
The (unalised) name of this entity in the database.
read-onlyoverride
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- sql → String
-
The sql statement that should be run in the default
onCreate
clause.read-only -
sqlByDialect
→ Map<
SqlDialect, String> -
The SQL statement to run, indexed by the dialect used in the database.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited