DBSQLiteAdapter constructor
DBSQLiteAdapter(
- String databasePath, {
- int? busyTimeout,
- int minConnections = 1,
- int maxConnections = 3,
- bool generateTables = false,
- bool checkTables = true,
- Object? populateTables,
- Object? populateSource,
- Object? populateSourceVariables,
- EntityRepositoryProvider? parentRepositoryProvider,
- String? workingPath,
- bool logSQL = false,
Implementation
DBSQLiteAdapter(
String databasePath, {
int? busyTimeout,
int minConnections = 1,
int maxConnections = 3,
super.generateTables,
super.checkTables,
super.populateTables,
super.populateSource,
super.populateSourceVariables,
super.parentRepositoryProvider,
super.workingPath,
super.logSQL,
}) : databasePath = databasePath,
inMemory = _isMemoryPath(databasePath),
busyTimeout = busyTimeout ?? 5000,
super(
'sqlite',
minConnections,
maxConnections,
DBSQLAdapterCapability(
dialect: const SQLDialect(
'SQLite',
elementQuote: '"',
acceptsReturningSyntax: true,
// SQLite rejects `RETURNING "alias".*`:
// "RETURNING may not use TABLE.* wildcards".
returningAcceptsTableWildcard: false,
acceptsInsertDefaultValues: true,
// `INSERT IGNORE` is MySQL-only; SQLite uses `ON CONFLICT`:
acceptsInsertIgnore: false,
acceptsInsertOnConflict: true,
acceptsVarcharWithoutMaximumSize: true,
// SQLite does NOT create an implicit index for a foreign key:
foreignKeyCreatesImplicitIndex: false,
createIndexIfNotExists: true,
// SQLite can't parse an `OFFSET` without a preceding `LIMIT`,
// and uses `LIMIT -1` as "no limit":
offsetRequiresLimit: true,
offsetMaxLimitValue: '-1',
),
transactions: true,
transactionAbort: true,
tableSQL: true,
// SQLite can't `ALTER TABLE ... ADD CONSTRAINT`:
constraintSupport: false,
// A `sqlite3` handle can't be shared with another isolate:
multiIsolateSupport: false,
connectivity: DBAdapterCapabilityConnectivity.none,
),
) {
boot();
parentRepositoryProvider?.notifyKnownEntityRepositoryProvider(this);
}