SQLGenerator class abstract mixin

Base class for a SQL generator.

Implementers

Constructors

SQLGenerator()

Properties

dialect → SQLDialect
The generated SQL dialect.
no setter
dialectName → String
The generated SQL dialect name.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

entityTypeToSQLType(TypeInfo type, String? column, {List<EntityField>? entityFieldAnnotations}) → MapEntry<String, MapEntry<String, String>>?
Returns info for the column: table -> idName: sqlType
enumTypeToSQLType(Type type, String column, {List<EntityField>? entityFieldAnnotations}) → MapEntry<String, List<String>>?
Returns: ENUM: valuesNames
foreignKeyTypeToSQLType(TypeInfo idType, String idName, {List<EntityField>? entityFieldAnnotations}) → String?
generateAddColumnAlterTableSQL(String table, String fieldName, TypeInfo fieldType, {List<EntityField>? entityFieldAnnotations}) → AlterTableSQL
generateAddEnumConstraintAlterTableSQL(String table, String fieldName, TypeInfo fieldType, {List<EntityField>? entityFieldAnnotations}) → AlterTableSQL
generateAddUniqueConstraintAlterTableSQL(String table, String fieldName, TypeInfo fieldType, {List<EntityField>? entityFieldAnnotations}) → AlterTableSQL
generateAddUniqueConstraintSQL(String table, String name, List<String> columns, {String? comment}) → SQLBuilder
Adds the unique constraint name over columns to the existing table: ALTER TABLE ... ADD CONSTRAINT ... UNIQUE (...) (as in the CREATE TABLE), or, if the dialect can't add a constraint to a table (SQLDialect.alterTableAddConstraint: SQLite), a CREATE UNIQUE INDEX (the same uniqueness).
generateCreateTableSQL({EntityRepository<Object>? entityRepository, Object? obj, Type? type, String? name, String? tableName, bool ifNotExists = true, bool sortColumns = true}) → CreateTableSQL
generateCreateTableSQLs({bool ifNotExists = true, bool sortColumns = true}) → FutureOr<List<SQLBuilder>>
generateDropConstraintSQL(String table, String name) → String
Drops the constraint name of table: ALTER TABLE table DROP CONSTRAINT IF EXISTS name.
generateDropIndexSQL(String table, String name) → String
Drops the index name of table: DROP INDEX IF EXISTS name, or DROP INDEX name ON table (SQLDialect.dropIndexOnTable: MySQL).
generateEntityIndexesSQLs(EntityHandler entityHandler, String table, {String? fieldColumn(String fieldName)?}) → List<CreateIndexSQL>
The CREATE INDEX SQLs of the EntityIndexes of the entityHandler's entity, in table.
generateFullCreateTableSQLs({String? title, bool withDate = true, bool ifNotExists = true, bool sortColumns = true}) → Future<String>
Generate a full text with all the SQLs to create the tables.
getEntityRepository<O extends Object>({O? obj, Type? type, String? name, String? tableName, Set<EntityRepositoryProvider>? traversed}) → EntityRepository<O>?
  • traversed: internal, see EntityRepositoryProvider.lookupEntityRepository.
  • getEntityRepositoryByType<O extends Object>(Type type, {Set<EntityRepositoryProvider>? traversed}) → EntityRepository<O>?
  • traversed: internal, see EntityRepositoryProvider.lookupEntityRepository.
  • getEntityRepositoryByTypeInfo<O extends Object>(TypeInfo typeInfo) → EntityRepository<O>?
    getTableForEntityRepository(EntityRepository<Object> entityRepository) → String
    getVarcharPreferredSize(String? column) → int
    Returns the preferred VARCHAR size for a column name.
    isSiblingEntityType(EntityRepository<Object> tableRepository, Type columnType, {EntityRepository<Object>? columnRepository}) → bool
    Returns true if columnType is a sibling of the tableRepository.
    normalizeColumnName(String fieldName) → String
    noSuchMethod(Invocation invocation) → dynamic
    Invoked when a nonexistent method or property is accessed.
    inherited
    primaryKeyTypeToSQLType(Type type, {List<EntityField>? entityFieldAnnotations}) → String?
    resolveEntityIndexColumns(EntityHandler entityHandler, EntityIndex entityIndex) → List<String>
    The columns of the entityIndex fields of the entityHandler's entity (in the index's order).
    toString() → String
    A string representation of this object.
    inherited
    typeToSQLType(TypeInfo type, String column, {List<EntityField>? entityFieldAnnotations, bool isID = false}) → String?

    Operators

    operator ==(Object other) → bool
    The equality operator.
    inherited