tane/apps/app_seeds/lib/db/database.g.dart
vjrj 040f15a898 feat(block1): inventory walking skeleton + first quick-add slice
Stand up the Tanemaki monorepo and the first end-to-end vertical slice of
Block 1 (offline, encrypted inventory): add a seed → see it in a categorized,
searchable list → it persists → reopen and it's still there.

Architecture (state management like G1nkgo, adapted to Tane's reality):
- flutter_bloc (Cubit-first), but the encrypted Drift DB is the single source
  of truth; cubits stream from repositories (no hydrated_bloc/Hive, which would
  write plaintext at rest).
- get_it composition root; go_router; slang i18n (ES/EN, Weblate-friendly JSON).

Workspace & core:
- pub workspace: packages/commons_core (pure Dart) + apps/app_seeds (Flutter).
- commons_core primitives: UUIDv7 IdGen, Hybrid Logical Clock, Quantity value
  type (+ plant-aware QuantityKind), IdentityService root-seed stub.

Data & security:
- Drift schemaVersion=1 with all 10 Block-1 tables + common CRDT columns
  (HLC updated_at, last_author, tombstones); Movement append-only.
- SQLCipher via an injectable executor that refuses to open a plaintext DB;
  DB key + root seed in the OS keystore (separate secrets).
- Exported drift_schema_v1.json + migration scaffold.

Tests (near-TDD; nothing merges without tests):
- commons_core units (24), Drift migration test, "no plaintext at rest"
  security guard (runs where SQLCipher is present, skips otherwise),
  repository, widget, full quick-add flow, file-reopen persistence, and a
  no-hardcoded-strings i18n guard. GitLab CI: format + analyze + test + coverage.

Follow-on Block-1 stories (item detail/edit, species catalog, germination UI)
and all of Block 2 remain out of scope.
2026-07-07 15:16:14 +02:00

10194 lines
327 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'database.dart';
// ignore_for_file: type=lint
class $VarietiesTable extends Varieties
with TableInfo<$VarietiesTable, Variety> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$VarietiesTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
'isDeleted',
);
@override
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_deleted" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
static const VerificationMeta _labelMeta = const VerificationMeta('label');
@override
late final GeneratedColumn<String> label = GeneratedColumn<String>(
'label',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _speciesIdMeta = const VerificationMeta(
'speciesId',
);
@override
late final GeneratedColumn<String> speciesId = GeneratedColumn<String>(
'species_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _cultivarNameMeta = const VerificationMeta(
'cultivarName',
);
@override
late final GeneratedColumn<String> cultivarName = GeneratedColumn<String>(
'cultivar_name',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _categoryMeta = const VerificationMeta(
'category',
);
@override
late final GeneratedColumn<String> category = GeneratedColumn<String>(
'category',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
@override
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
'notes',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
label,
speciesId,
cultivarName,
category,
notes,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'varieties';
@override
VerificationContext validateIntegrity(
Insertable<Variety> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
} else if (isInserting) {
context.missing(_updatedAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('is_deleted')) {
context.handle(
_isDeletedMeta,
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('label')) {
context.handle(
_labelMeta,
label.isAcceptableOrUnknown(data['label']!, _labelMeta),
);
} else if (isInserting) {
context.missing(_labelMeta);
}
if (data.containsKey('species_id')) {
context.handle(
_speciesIdMeta,
speciesId.isAcceptableOrUnknown(data['species_id']!, _speciesIdMeta),
);
}
if (data.containsKey('cultivar_name')) {
context.handle(
_cultivarNameMeta,
cultivarName.isAcceptableOrUnknown(
data['cultivar_name']!,
_cultivarNameMeta,
),
);
}
if (data.containsKey('category')) {
context.handle(
_categoryMeta,
category.isAcceptableOrUnknown(data['category']!, _categoryMeta),
);
}
if (data.containsKey('notes')) {
context.handle(
_notesMeta,
notes.isAcceptableOrUnknown(data['notes']!, _notesMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Variety map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Variety(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}updated_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
isDeleted: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_deleted'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
label: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}label'],
)!,
speciesId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}species_id'],
),
cultivarName: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}cultivar_name'],
),
category: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}category'],
),
notes: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}notes'],
),
);
}
@override
$VarietiesTable createAlias(String alias) {
return $VarietiesTable(attachedDatabase, alias);
}
}
class Variety extends DataClass implements Insertable<Variety> {
final String id;
final int createdAt;
final String updatedAt;
final String lastAuthor;
final bool isDeleted;
final int schemaRowVersion;
final String label;
final String? speciesId;
final String? cultivarName;
final String? category;
final String? notes;
const Variety({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.lastAuthor,
required this.isDeleted,
required this.schemaRowVersion,
required this.label,
this.speciesId,
this.cultivarName,
this.category,
this.notes,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['updated_at'] = Variable<String>(updatedAt);
map['last_author'] = Variable<String>(lastAuthor);
map['is_deleted'] = Variable<bool>(isDeleted);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
map['label'] = Variable<String>(label);
if (!nullToAbsent || speciesId != null) {
map['species_id'] = Variable<String>(speciesId);
}
if (!nullToAbsent || cultivarName != null) {
map['cultivar_name'] = Variable<String>(cultivarName);
}
if (!nullToAbsent || category != null) {
map['category'] = Variable<String>(category);
}
if (!nullToAbsent || notes != null) {
map['notes'] = Variable<String>(notes);
}
return map;
}
VarietiesCompanion toCompanion(bool nullToAbsent) {
return VarietiesCompanion(
id: Value(id),
createdAt: Value(createdAt),
updatedAt: Value(updatedAt),
lastAuthor: Value(lastAuthor),
isDeleted: Value(isDeleted),
schemaRowVersion: Value(schemaRowVersion),
label: Value(label),
speciesId: speciesId == null && nullToAbsent
? const Value.absent()
: Value(speciesId),
cultivarName: cultivarName == null && nullToAbsent
? const Value.absent()
: Value(cultivarName),
category: category == null && nullToAbsent
? const Value.absent()
: Value(category),
notes: notes == null && nullToAbsent
? const Value.absent()
: Value(notes),
);
}
factory Variety.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Variety(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
updatedAt: serializer.fromJson<String>(json['updatedAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
label: serializer.fromJson<String>(json['label']),
speciesId: serializer.fromJson<String?>(json['speciesId']),
cultivarName: serializer.fromJson<String?>(json['cultivarName']),
category: serializer.fromJson<String?>(json['category']),
notes: serializer.fromJson<String?>(json['notes']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'updatedAt': serializer.toJson<String>(updatedAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'isDeleted': serializer.toJson<bool>(isDeleted),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'label': serializer.toJson<String>(label),
'speciesId': serializer.toJson<String?>(speciesId),
'cultivarName': serializer.toJson<String?>(cultivarName),
'category': serializer.toJson<String?>(category),
'notes': serializer.toJson<String?>(notes),
};
}
Variety copyWith({
String? id,
int? createdAt,
String? updatedAt,
String? lastAuthor,
bool? isDeleted,
int? schemaRowVersion,
String? label,
Value<String?> speciesId = const Value.absent(),
Value<String?> cultivarName = const Value.absent(),
Value<String?> category = const Value.absent(),
Value<String?> notes = const Value.absent(),
}) => Variety(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
label: label ?? this.label,
speciesId: speciesId.present ? speciesId.value : this.speciesId,
cultivarName: cultivarName.present ? cultivarName.value : this.cultivarName,
category: category.present ? category.value : this.category,
notes: notes.present ? notes.value : this.notes,
);
Variety copyWithCompanion(VarietiesCompanion data) {
return Variety(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
label: data.label.present ? data.label.value : this.label,
speciesId: data.speciesId.present ? data.speciesId.value : this.speciesId,
cultivarName: data.cultivarName.present
? data.cultivarName.value
: this.cultivarName,
category: data.category.present ? data.category.value : this.category,
notes: data.notes.present ? data.notes.value : this.notes,
);
}
@override
String toString() {
return (StringBuffer('Variety(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('label: $label, ')
..write('speciesId: $speciesId, ')
..write('cultivarName: $cultivarName, ')
..write('category: $category, ')
..write('notes: $notes')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
label,
speciesId,
cultivarName,
category,
notes,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Variety &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.updatedAt == this.updatedAt &&
other.lastAuthor == this.lastAuthor &&
other.isDeleted == this.isDeleted &&
other.schemaRowVersion == this.schemaRowVersion &&
other.label == this.label &&
other.speciesId == this.speciesId &&
other.cultivarName == this.cultivarName &&
other.category == this.category &&
other.notes == this.notes);
}
class VarietiesCompanion extends UpdateCompanion<Variety> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> updatedAt;
final Value<String> lastAuthor;
final Value<bool> isDeleted;
final Value<int> schemaRowVersion;
final Value<String> label;
final Value<String?> speciesId;
final Value<String?> cultivarName;
final Value<String?> category;
final Value<String?> notes;
final Value<int> rowid;
const VarietiesCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.updatedAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.label = const Value.absent(),
this.speciesId = const Value.absent(),
this.cultivarName = const Value.absent(),
this.category = const Value.absent(),
this.notes = const Value.absent(),
this.rowid = const Value.absent(),
});
VarietiesCompanion.insert({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
required String label,
this.speciesId = const Value.absent(),
this.cultivarName = const Value.absent(),
this.category = const Value.absent(),
this.notes = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
updatedAt = Value(updatedAt),
lastAuthor = Value(lastAuthor),
label = Value(label);
static Insertable<Variety> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? updatedAt,
Expression<String>? lastAuthor,
Expression<bool>? isDeleted,
Expression<int>? schemaRowVersion,
Expression<String>? label,
Expression<String>? speciesId,
Expression<String>? cultivarName,
Expression<String>? category,
Expression<String>? notes,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (updatedAt != null) 'updated_at': updatedAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (isDeleted != null) 'is_deleted': isDeleted,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (label != null) 'label': label,
if (speciesId != null) 'species_id': speciesId,
if (cultivarName != null) 'cultivar_name': cultivarName,
if (category != null) 'category': category,
if (notes != null) 'notes': notes,
if (rowid != null) 'rowid': rowid,
});
}
VarietiesCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? updatedAt,
Value<String>? lastAuthor,
Value<bool>? isDeleted,
Value<int>? schemaRowVersion,
Value<String>? label,
Value<String?>? speciesId,
Value<String?>? cultivarName,
Value<String?>? category,
Value<String?>? notes,
Value<int>? rowid,
}) {
return VarietiesCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
label: label ?? this.label,
speciesId: speciesId ?? this.speciesId,
cultivarName: cultivarName ?? this.cultivarName,
category: category ?? this.category,
notes: notes ?? this.notes,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<String>(updatedAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (isDeleted.present) {
map['is_deleted'] = Variable<bool>(isDeleted.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (label.present) {
map['label'] = Variable<String>(label.value);
}
if (speciesId.present) {
map['species_id'] = Variable<String>(speciesId.value);
}
if (cultivarName.present) {
map['cultivar_name'] = Variable<String>(cultivarName.value);
}
if (category.present) {
map['category'] = Variable<String>(category.value);
}
if (notes.present) {
map['notes'] = Variable<String>(notes.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('VarietiesCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('label: $label, ')
..write('speciesId: $speciesId, ')
..write('cultivarName: $cultivarName, ')
..write('category: $category, ')
..write('notes: $notes, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $VarietyVernacularNamesTable extends VarietyVernacularNames
with TableInfo<$VarietyVernacularNamesTable, VarietyVernacularName> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$VarietyVernacularNamesTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
'isDeleted',
);
@override
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_deleted" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
static const VerificationMeta _varietyIdMeta = const VerificationMeta(
'varietyId',
);
@override
late final GeneratedColumn<String> varietyId = GeneratedColumn<String>(
'variety_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _nameMeta = const VerificationMeta('name');
@override
late final GeneratedColumn<String> name = GeneratedColumn<String>(
'name',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _languageMeta = const VerificationMeta(
'language',
);
@override
late final GeneratedColumn<String> language = GeneratedColumn<String>(
'language',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _regionMeta = const VerificationMeta('region');
@override
late final GeneratedColumn<String> region = GeneratedColumn<String>(
'region',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
varietyId,
name,
language,
region,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'variety_vernacular_names';
@override
VerificationContext validateIntegrity(
Insertable<VarietyVernacularName> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
} else if (isInserting) {
context.missing(_updatedAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('is_deleted')) {
context.handle(
_isDeletedMeta,
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('variety_id')) {
context.handle(
_varietyIdMeta,
varietyId.isAcceptableOrUnknown(data['variety_id']!, _varietyIdMeta),
);
} else if (isInserting) {
context.missing(_varietyIdMeta);
}
if (data.containsKey('name')) {
context.handle(
_nameMeta,
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
);
} else if (isInserting) {
context.missing(_nameMeta);
}
if (data.containsKey('language')) {
context.handle(
_languageMeta,
language.isAcceptableOrUnknown(data['language']!, _languageMeta),
);
}
if (data.containsKey('region')) {
context.handle(
_regionMeta,
region.isAcceptableOrUnknown(data['region']!, _regionMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
VarietyVernacularName map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return VarietyVernacularName(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}updated_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
isDeleted: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_deleted'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
varietyId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}variety_id'],
)!,
name: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}name'],
)!,
language: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}language'],
),
region: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}region'],
),
);
}
@override
$VarietyVernacularNamesTable createAlias(String alias) {
return $VarietyVernacularNamesTable(attachedDatabase, alias);
}
}
class VarietyVernacularName extends DataClass
implements Insertable<VarietyVernacularName> {
final String id;
final int createdAt;
final String updatedAt;
final String lastAuthor;
final bool isDeleted;
final int schemaRowVersion;
final String varietyId;
final String name;
final String? language;
final String? region;
const VarietyVernacularName({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.lastAuthor,
required this.isDeleted,
required this.schemaRowVersion,
required this.varietyId,
required this.name,
this.language,
this.region,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['updated_at'] = Variable<String>(updatedAt);
map['last_author'] = Variable<String>(lastAuthor);
map['is_deleted'] = Variable<bool>(isDeleted);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
map['variety_id'] = Variable<String>(varietyId);
map['name'] = Variable<String>(name);
if (!nullToAbsent || language != null) {
map['language'] = Variable<String>(language);
}
if (!nullToAbsent || region != null) {
map['region'] = Variable<String>(region);
}
return map;
}
VarietyVernacularNamesCompanion toCompanion(bool nullToAbsent) {
return VarietyVernacularNamesCompanion(
id: Value(id),
createdAt: Value(createdAt),
updatedAt: Value(updatedAt),
lastAuthor: Value(lastAuthor),
isDeleted: Value(isDeleted),
schemaRowVersion: Value(schemaRowVersion),
varietyId: Value(varietyId),
name: Value(name),
language: language == null && nullToAbsent
? const Value.absent()
: Value(language),
region: region == null && nullToAbsent
? const Value.absent()
: Value(region),
);
}
factory VarietyVernacularName.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return VarietyVernacularName(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
updatedAt: serializer.fromJson<String>(json['updatedAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
varietyId: serializer.fromJson<String>(json['varietyId']),
name: serializer.fromJson<String>(json['name']),
language: serializer.fromJson<String?>(json['language']),
region: serializer.fromJson<String?>(json['region']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'updatedAt': serializer.toJson<String>(updatedAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'isDeleted': serializer.toJson<bool>(isDeleted),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'varietyId': serializer.toJson<String>(varietyId),
'name': serializer.toJson<String>(name),
'language': serializer.toJson<String?>(language),
'region': serializer.toJson<String?>(region),
};
}
VarietyVernacularName copyWith({
String? id,
int? createdAt,
String? updatedAt,
String? lastAuthor,
bool? isDeleted,
int? schemaRowVersion,
String? varietyId,
String? name,
Value<String?> language = const Value.absent(),
Value<String?> region = const Value.absent(),
}) => VarietyVernacularName(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
varietyId: varietyId ?? this.varietyId,
name: name ?? this.name,
language: language.present ? language.value : this.language,
region: region.present ? region.value : this.region,
);
VarietyVernacularName copyWithCompanion(
VarietyVernacularNamesCompanion data,
) {
return VarietyVernacularName(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
varietyId: data.varietyId.present ? data.varietyId.value : this.varietyId,
name: data.name.present ? data.name.value : this.name,
language: data.language.present ? data.language.value : this.language,
region: data.region.present ? data.region.value : this.region,
);
}
@override
String toString() {
return (StringBuffer('VarietyVernacularName(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('varietyId: $varietyId, ')
..write('name: $name, ')
..write('language: $language, ')
..write('region: $region')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
varietyId,
name,
language,
region,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is VarietyVernacularName &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.updatedAt == this.updatedAt &&
other.lastAuthor == this.lastAuthor &&
other.isDeleted == this.isDeleted &&
other.schemaRowVersion == this.schemaRowVersion &&
other.varietyId == this.varietyId &&
other.name == this.name &&
other.language == this.language &&
other.region == this.region);
}
class VarietyVernacularNamesCompanion
extends UpdateCompanion<VarietyVernacularName> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> updatedAt;
final Value<String> lastAuthor;
final Value<bool> isDeleted;
final Value<int> schemaRowVersion;
final Value<String> varietyId;
final Value<String> name;
final Value<String?> language;
final Value<String?> region;
final Value<int> rowid;
const VarietyVernacularNamesCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.updatedAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.varietyId = const Value.absent(),
this.name = const Value.absent(),
this.language = const Value.absent(),
this.region = const Value.absent(),
this.rowid = const Value.absent(),
});
VarietyVernacularNamesCompanion.insert({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
required String varietyId,
required String name,
this.language = const Value.absent(),
this.region = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
updatedAt = Value(updatedAt),
lastAuthor = Value(lastAuthor),
varietyId = Value(varietyId),
name = Value(name);
static Insertable<VarietyVernacularName> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? updatedAt,
Expression<String>? lastAuthor,
Expression<bool>? isDeleted,
Expression<int>? schemaRowVersion,
Expression<String>? varietyId,
Expression<String>? name,
Expression<String>? language,
Expression<String>? region,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (updatedAt != null) 'updated_at': updatedAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (isDeleted != null) 'is_deleted': isDeleted,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (varietyId != null) 'variety_id': varietyId,
if (name != null) 'name': name,
if (language != null) 'language': language,
if (region != null) 'region': region,
if (rowid != null) 'rowid': rowid,
});
}
VarietyVernacularNamesCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? updatedAt,
Value<String>? lastAuthor,
Value<bool>? isDeleted,
Value<int>? schemaRowVersion,
Value<String>? varietyId,
Value<String>? name,
Value<String?>? language,
Value<String?>? region,
Value<int>? rowid,
}) {
return VarietyVernacularNamesCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
varietyId: varietyId ?? this.varietyId,
name: name ?? this.name,
language: language ?? this.language,
region: region ?? this.region,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<String>(updatedAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (isDeleted.present) {
map['is_deleted'] = Variable<bool>(isDeleted.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (varietyId.present) {
map['variety_id'] = Variable<String>(varietyId.value);
}
if (name.present) {
map['name'] = Variable<String>(name.value);
}
if (language.present) {
map['language'] = Variable<String>(language.value);
}
if (region.present) {
map['region'] = Variable<String>(region.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('VarietyVernacularNamesCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('varietyId: $varietyId, ')
..write('name: $name, ')
..write('language: $language, ')
..write('region: $region, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $SpeciesTable extends Species with TableInfo<$SpeciesTable, Specy> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$SpeciesTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
'isDeleted',
);
@override
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_deleted" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
static const VerificationMeta _scientificNameMeta = const VerificationMeta(
'scientificName',
);
@override
late final GeneratedColumn<String> scientificName = GeneratedColumn<String>(
'scientific_name',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _wikidataQidMeta = const VerificationMeta(
'wikidataQid',
);
@override
late final GeneratedColumn<String> wikidataQid = GeneratedColumn<String>(
'wikidata_qid',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _gbifKeyMeta = const VerificationMeta(
'gbifKey',
);
@override
late final GeneratedColumn<int> gbifKey = GeneratedColumn<int>(
'gbif_key',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
);
static const VerificationMeta _familyMeta = const VerificationMeta('family');
@override
late final GeneratedColumn<String> family = GeneratedColumn<String>(
'family',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _isBundledMeta = const VerificationMeta(
'isBundled',
);
@override
late final GeneratedColumn<bool> isBundled = GeneratedColumn<bool>(
'is_bundled',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_bundled" IN (0, 1))',
),
defaultValue: const Constant(false),
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
scientificName,
wikidataQid,
gbifKey,
family,
isBundled,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'species';
@override
VerificationContext validateIntegrity(
Insertable<Specy> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
} else if (isInserting) {
context.missing(_updatedAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('is_deleted')) {
context.handle(
_isDeletedMeta,
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('scientific_name')) {
context.handle(
_scientificNameMeta,
scientificName.isAcceptableOrUnknown(
data['scientific_name']!,
_scientificNameMeta,
),
);
} else if (isInserting) {
context.missing(_scientificNameMeta);
}
if (data.containsKey('wikidata_qid')) {
context.handle(
_wikidataQidMeta,
wikidataQid.isAcceptableOrUnknown(
data['wikidata_qid']!,
_wikidataQidMeta,
),
);
}
if (data.containsKey('gbif_key')) {
context.handle(
_gbifKeyMeta,
gbifKey.isAcceptableOrUnknown(data['gbif_key']!, _gbifKeyMeta),
);
}
if (data.containsKey('family')) {
context.handle(
_familyMeta,
family.isAcceptableOrUnknown(data['family']!, _familyMeta),
);
}
if (data.containsKey('is_bundled')) {
context.handle(
_isBundledMeta,
isBundled.isAcceptableOrUnknown(data['is_bundled']!, _isBundledMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Specy map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Specy(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}updated_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
isDeleted: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_deleted'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
scientificName: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}scientific_name'],
)!,
wikidataQid: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}wikidata_qid'],
),
gbifKey: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}gbif_key'],
),
family: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}family'],
),
isBundled: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_bundled'],
)!,
);
}
@override
$SpeciesTable createAlias(String alias) {
return $SpeciesTable(attachedDatabase, alias);
}
}
class Specy extends DataClass implements Insertable<Specy> {
final String id;
final int createdAt;
final String updatedAt;
final String lastAuthor;
final bool isDeleted;
final int schemaRowVersion;
final String scientificName;
final String? wikidataQid;
final int? gbifKey;
final String? family;
final bool isBundled;
const Specy({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.lastAuthor,
required this.isDeleted,
required this.schemaRowVersion,
required this.scientificName,
this.wikidataQid,
this.gbifKey,
this.family,
required this.isBundled,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['updated_at'] = Variable<String>(updatedAt);
map['last_author'] = Variable<String>(lastAuthor);
map['is_deleted'] = Variable<bool>(isDeleted);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
map['scientific_name'] = Variable<String>(scientificName);
if (!nullToAbsent || wikidataQid != null) {
map['wikidata_qid'] = Variable<String>(wikidataQid);
}
if (!nullToAbsent || gbifKey != null) {
map['gbif_key'] = Variable<int>(gbifKey);
}
if (!nullToAbsent || family != null) {
map['family'] = Variable<String>(family);
}
map['is_bundled'] = Variable<bool>(isBundled);
return map;
}
SpeciesCompanion toCompanion(bool nullToAbsent) {
return SpeciesCompanion(
id: Value(id),
createdAt: Value(createdAt),
updatedAt: Value(updatedAt),
lastAuthor: Value(lastAuthor),
isDeleted: Value(isDeleted),
schemaRowVersion: Value(schemaRowVersion),
scientificName: Value(scientificName),
wikidataQid: wikidataQid == null && nullToAbsent
? const Value.absent()
: Value(wikidataQid),
gbifKey: gbifKey == null && nullToAbsent
? const Value.absent()
: Value(gbifKey),
family: family == null && nullToAbsent
? const Value.absent()
: Value(family),
isBundled: Value(isBundled),
);
}
factory Specy.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Specy(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
updatedAt: serializer.fromJson<String>(json['updatedAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
scientificName: serializer.fromJson<String>(json['scientificName']),
wikidataQid: serializer.fromJson<String?>(json['wikidataQid']),
gbifKey: serializer.fromJson<int?>(json['gbifKey']),
family: serializer.fromJson<String?>(json['family']),
isBundled: serializer.fromJson<bool>(json['isBundled']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'updatedAt': serializer.toJson<String>(updatedAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'isDeleted': serializer.toJson<bool>(isDeleted),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'scientificName': serializer.toJson<String>(scientificName),
'wikidataQid': serializer.toJson<String?>(wikidataQid),
'gbifKey': serializer.toJson<int?>(gbifKey),
'family': serializer.toJson<String?>(family),
'isBundled': serializer.toJson<bool>(isBundled),
};
}
Specy copyWith({
String? id,
int? createdAt,
String? updatedAt,
String? lastAuthor,
bool? isDeleted,
int? schemaRowVersion,
String? scientificName,
Value<String?> wikidataQid = const Value.absent(),
Value<int?> gbifKey = const Value.absent(),
Value<String?> family = const Value.absent(),
bool? isBundled,
}) => Specy(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
scientificName: scientificName ?? this.scientificName,
wikidataQid: wikidataQid.present ? wikidataQid.value : this.wikidataQid,
gbifKey: gbifKey.present ? gbifKey.value : this.gbifKey,
family: family.present ? family.value : this.family,
isBundled: isBundled ?? this.isBundled,
);
Specy copyWithCompanion(SpeciesCompanion data) {
return Specy(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
scientificName: data.scientificName.present
? data.scientificName.value
: this.scientificName,
wikidataQid: data.wikidataQid.present
? data.wikidataQid.value
: this.wikidataQid,
gbifKey: data.gbifKey.present ? data.gbifKey.value : this.gbifKey,
family: data.family.present ? data.family.value : this.family,
isBundled: data.isBundled.present ? data.isBundled.value : this.isBundled,
);
}
@override
String toString() {
return (StringBuffer('Specy(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('scientificName: $scientificName, ')
..write('wikidataQid: $wikidataQid, ')
..write('gbifKey: $gbifKey, ')
..write('family: $family, ')
..write('isBundled: $isBundled')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
scientificName,
wikidataQid,
gbifKey,
family,
isBundled,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Specy &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.updatedAt == this.updatedAt &&
other.lastAuthor == this.lastAuthor &&
other.isDeleted == this.isDeleted &&
other.schemaRowVersion == this.schemaRowVersion &&
other.scientificName == this.scientificName &&
other.wikidataQid == this.wikidataQid &&
other.gbifKey == this.gbifKey &&
other.family == this.family &&
other.isBundled == this.isBundled);
}
class SpeciesCompanion extends UpdateCompanion<Specy> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> updatedAt;
final Value<String> lastAuthor;
final Value<bool> isDeleted;
final Value<int> schemaRowVersion;
final Value<String> scientificName;
final Value<String?> wikidataQid;
final Value<int?> gbifKey;
final Value<String?> family;
final Value<bool> isBundled;
final Value<int> rowid;
const SpeciesCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.updatedAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.scientificName = const Value.absent(),
this.wikidataQid = const Value.absent(),
this.gbifKey = const Value.absent(),
this.family = const Value.absent(),
this.isBundled = const Value.absent(),
this.rowid = const Value.absent(),
});
SpeciesCompanion.insert({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
required String scientificName,
this.wikidataQid = const Value.absent(),
this.gbifKey = const Value.absent(),
this.family = const Value.absent(),
this.isBundled = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
updatedAt = Value(updatedAt),
lastAuthor = Value(lastAuthor),
scientificName = Value(scientificName);
static Insertable<Specy> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? updatedAt,
Expression<String>? lastAuthor,
Expression<bool>? isDeleted,
Expression<int>? schemaRowVersion,
Expression<String>? scientificName,
Expression<String>? wikidataQid,
Expression<int>? gbifKey,
Expression<String>? family,
Expression<bool>? isBundled,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (updatedAt != null) 'updated_at': updatedAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (isDeleted != null) 'is_deleted': isDeleted,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (scientificName != null) 'scientific_name': scientificName,
if (wikidataQid != null) 'wikidata_qid': wikidataQid,
if (gbifKey != null) 'gbif_key': gbifKey,
if (family != null) 'family': family,
if (isBundled != null) 'is_bundled': isBundled,
if (rowid != null) 'rowid': rowid,
});
}
SpeciesCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? updatedAt,
Value<String>? lastAuthor,
Value<bool>? isDeleted,
Value<int>? schemaRowVersion,
Value<String>? scientificName,
Value<String?>? wikidataQid,
Value<int?>? gbifKey,
Value<String?>? family,
Value<bool>? isBundled,
Value<int>? rowid,
}) {
return SpeciesCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
scientificName: scientificName ?? this.scientificName,
wikidataQid: wikidataQid ?? this.wikidataQid,
gbifKey: gbifKey ?? this.gbifKey,
family: family ?? this.family,
isBundled: isBundled ?? this.isBundled,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<String>(updatedAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (isDeleted.present) {
map['is_deleted'] = Variable<bool>(isDeleted.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (scientificName.present) {
map['scientific_name'] = Variable<String>(scientificName.value);
}
if (wikidataQid.present) {
map['wikidata_qid'] = Variable<String>(wikidataQid.value);
}
if (gbifKey.present) {
map['gbif_key'] = Variable<int>(gbifKey.value);
}
if (family.present) {
map['family'] = Variable<String>(family.value);
}
if (isBundled.present) {
map['is_bundled'] = Variable<bool>(isBundled.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('SpeciesCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('scientificName: $scientificName, ')
..write('wikidataQid: $wikidataQid, ')
..write('gbifKey: $gbifKey, ')
..write('family: $family, ')
..write('isBundled: $isBundled, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $SpeciesCommonNamesTable extends SpeciesCommonNames
with TableInfo<$SpeciesCommonNamesTable, SpeciesCommonName> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$SpeciesCommonNamesTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
'isDeleted',
);
@override
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_deleted" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
static const VerificationMeta _speciesIdMeta = const VerificationMeta(
'speciesId',
);
@override
late final GeneratedColumn<String> speciesId = GeneratedColumn<String>(
'species_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _nameMeta = const VerificationMeta('name');
@override
late final GeneratedColumn<String> name = GeneratedColumn<String>(
'name',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _languageMeta = const VerificationMeta(
'language',
);
@override
late final GeneratedColumn<String> language = GeneratedColumn<String>(
'language',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
speciesId,
name,
language,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'species_common_names';
@override
VerificationContext validateIntegrity(
Insertable<SpeciesCommonName> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
} else if (isInserting) {
context.missing(_updatedAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('is_deleted')) {
context.handle(
_isDeletedMeta,
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('species_id')) {
context.handle(
_speciesIdMeta,
speciesId.isAcceptableOrUnknown(data['species_id']!, _speciesIdMeta),
);
} else if (isInserting) {
context.missing(_speciesIdMeta);
}
if (data.containsKey('name')) {
context.handle(
_nameMeta,
name.isAcceptableOrUnknown(data['name']!, _nameMeta),
);
} else if (isInserting) {
context.missing(_nameMeta);
}
if (data.containsKey('language')) {
context.handle(
_languageMeta,
language.isAcceptableOrUnknown(data['language']!, _languageMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
SpeciesCommonName map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return SpeciesCommonName(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}updated_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
isDeleted: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_deleted'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
speciesId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}species_id'],
)!,
name: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}name'],
)!,
language: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}language'],
),
);
}
@override
$SpeciesCommonNamesTable createAlias(String alias) {
return $SpeciesCommonNamesTable(attachedDatabase, alias);
}
}
class SpeciesCommonName extends DataClass
implements Insertable<SpeciesCommonName> {
final String id;
final int createdAt;
final String updatedAt;
final String lastAuthor;
final bool isDeleted;
final int schemaRowVersion;
final String speciesId;
final String name;
final String? language;
const SpeciesCommonName({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.lastAuthor,
required this.isDeleted,
required this.schemaRowVersion,
required this.speciesId,
required this.name,
this.language,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['updated_at'] = Variable<String>(updatedAt);
map['last_author'] = Variable<String>(lastAuthor);
map['is_deleted'] = Variable<bool>(isDeleted);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
map['species_id'] = Variable<String>(speciesId);
map['name'] = Variable<String>(name);
if (!nullToAbsent || language != null) {
map['language'] = Variable<String>(language);
}
return map;
}
SpeciesCommonNamesCompanion toCompanion(bool nullToAbsent) {
return SpeciesCommonNamesCompanion(
id: Value(id),
createdAt: Value(createdAt),
updatedAt: Value(updatedAt),
lastAuthor: Value(lastAuthor),
isDeleted: Value(isDeleted),
schemaRowVersion: Value(schemaRowVersion),
speciesId: Value(speciesId),
name: Value(name),
language: language == null && nullToAbsent
? const Value.absent()
: Value(language),
);
}
factory SpeciesCommonName.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return SpeciesCommonName(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
updatedAt: serializer.fromJson<String>(json['updatedAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
speciesId: serializer.fromJson<String>(json['speciesId']),
name: serializer.fromJson<String>(json['name']),
language: serializer.fromJson<String?>(json['language']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'updatedAt': serializer.toJson<String>(updatedAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'isDeleted': serializer.toJson<bool>(isDeleted),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'speciesId': serializer.toJson<String>(speciesId),
'name': serializer.toJson<String>(name),
'language': serializer.toJson<String?>(language),
};
}
SpeciesCommonName copyWith({
String? id,
int? createdAt,
String? updatedAt,
String? lastAuthor,
bool? isDeleted,
int? schemaRowVersion,
String? speciesId,
String? name,
Value<String?> language = const Value.absent(),
}) => SpeciesCommonName(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
speciesId: speciesId ?? this.speciesId,
name: name ?? this.name,
language: language.present ? language.value : this.language,
);
SpeciesCommonName copyWithCompanion(SpeciesCommonNamesCompanion data) {
return SpeciesCommonName(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
speciesId: data.speciesId.present ? data.speciesId.value : this.speciesId,
name: data.name.present ? data.name.value : this.name,
language: data.language.present ? data.language.value : this.language,
);
}
@override
String toString() {
return (StringBuffer('SpeciesCommonName(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('speciesId: $speciesId, ')
..write('name: $name, ')
..write('language: $language')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
speciesId,
name,
language,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is SpeciesCommonName &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.updatedAt == this.updatedAt &&
other.lastAuthor == this.lastAuthor &&
other.isDeleted == this.isDeleted &&
other.schemaRowVersion == this.schemaRowVersion &&
other.speciesId == this.speciesId &&
other.name == this.name &&
other.language == this.language);
}
class SpeciesCommonNamesCompanion extends UpdateCompanion<SpeciesCommonName> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> updatedAt;
final Value<String> lastAuthor;
final Value<bool> isDeleted;
final Value<int> schemaRowVersion;
final Value<String> speciesId;
final Value<String> name;
final Value<String?> language;
final Value<int> rowid;
const SpeciesCommonNamesCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.updatedAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.speciesId = const Value.absent(),
this.name = const Value.absent(),
this.language = const Value.absent(),
this.rowid = const Value.absent(),
});
SpeciesCommonNamesCompanion.insert({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
required String speciesId,
required String name,
this.language = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
updatedAt = Value(updatedAt),
lastAuthor = Value(lastAuthor),
speciesId = Value(speciesId),
name = Value(name);
static Insertable<SpeciesCommonName> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? updatedAt,
Expression<String>? lastAuthor,
Expression<bool>? isDeleted,
Expression<int>? schemaRowVersion,
Expression<String>? speciesId,
Expression<String>? name,
Expression<String>? language,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (updatedAt != null) 'updated_at': updatedAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (isDeleted != null) 'is_deleted': isDeleted,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (speciesId != null) 'species_id': speciesId,
if (name != null) 'name': name,
if (language != null) 'language': language,
if (rowid != null) 'rowid': rowid,
});
}
SpeciesCommonNamesCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? updatedAt,
Value<String>? lastAuthor,
Value<bool>? isDeleted,
Value<int>? schemaRowVersion,
Value<String>? speciesId,
Value<String>? name,
Value<String?>? language,
Value<int>? rowid,
}) {
return SpeciesCommonNamesCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
speciesId: speciesId ?? this.speciesId,
name: name ?? this.name,
language: language ?? this.language,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<String>(updatedAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (isDeleted.present) {
map['is_deleted'] = Variable<bool>(isDeleted.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (speciesId.present) {
map['species_id'] = Variable<String>(speciesId.value);
}
if (name.present) {
map['name'] = Variable<String>(name.value);
}
if (language.present) {
map['language'] = Variable<String>(language.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('SpeciesCommonNamesCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('speciesId: $speciesId, ')
..write('name: $name, ')
..write('language: $language, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $LotsTable extends Lots with TableInfo<$LotsTable, Lot> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$LotsTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
'isDeleted',
);
@override
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_deleted" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
static const VerificationMeta _varietyIdMeta = const VerificationMeta(
'varietyId',
);
@override
late final GeneratedColumn<String> varietyId = GeneratedColumn<String>(
'variety_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _harvestYearMeta = const VerificationMeta(
'harvestYear',
);
@override
late final GeneratedColumn<int> harvestYear = GeneratedColumn<int>(
'harvest_year',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
);
static const VerificationMeta _quantityKindMeta = const VerificationMeta(
'quantityKind',
);
@override
late final GeneratedColumn<String> quantityKind = GeneratedColumn<String>(
'quantity_kind',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _quantityPreciseMeta = const VerificationMeta(
'quantityPrecise',
);
@override
late final GeneratedColumn<double> quantityPrecise = GeneratedColumn<double>(
'quantity_precise',
aliasedName,
true,
type: DriftSqlType.double,
requiredDuringInsert: false,
);
static const VerificationMeta _quantityLabelMeta = const VerificationMeta(
'quantityLabel',
);
@override
late final GeneratedColumn<String> quantityLabel = GeneratedColumn<String>(
'quantity_label',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _storageLocationMeta = const VerificationMeta(
'storageLocation',
);
@override
late final GeneratedColumn<String> storageLocation = GeneratedColumn<String>(
'storage_location',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
late final GeneratedColumnWithTypeConverter<OfferStatus, String> offerStatus =
GeneratedColumn<String>(
'offer_status',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: false,
defaultValue: const Constant('private'),
).withConverter<OfferStatus>($LotsTable.$converterofferStatus);
static const VerificationMeta _seedbankIdMeta = const VerificationMeta(
'seedbankId',
);
@override
late final GeneratedColumn<String> seedbankId = GeneratedColumn<String>(
'seedbank_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
varietyId,
harvestYear,
quantityKind,
quantityPrecise,
quantityLabel,
storageLocation,
offerStatus,
seedbankId,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'lots';
@override
VerificationContext validateIntegrity(
Insertable<Lot> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
} else if (isInserting) {
context.missing(_updatedAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('is_deleted')) {
context.handle(
_isDeletedMeta,
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('variety_id')) {
context.handle(
_varietyIdMeta,
varietyId.isAcceptableOrUnknown(data['variety_id']!, _varietyIdMeta),
);
} else if (isInserting) {
context.missing(_varietyIdMeta);
}
if (data.containsKey('harvest_year')) {
context.handle(
_harvestYearMeta,
harvestYear.isAcceptableOrUnknown(
data['harvest_year']!,
_harvestYearMeta,
),
);
}
if (data.containsKey('quantity_kind')) {
context.handle(
_quantityKindMeta,
quantityKind.isAcceptableOrUnknown(
data['quantity_kind']!,
_quantityKindMeta,
),
);
}
if (data.containsKey('quantity_precise')) {
context.handle(
_quantityPreciseMeta,
quantityPrecise.isAcceptableOrUnknown(
data['quantity_precise']!,
_quantityPreciseMeta,
),
);
}
if (data.containsKey('quantity_label')) {
context.handle(
_quantityLabelMeta,
quantityLabel.isAcceptableOrUnknown(
data['quantity_label']!,
_quantityLabelMeta,
),
);
}
if (data.containsKey('storage_location')) {
context.handle(
_storageLocationMeta,
storageLocation.isAcceptableOrUnknown(
data['storage_location']!,
_storageLocationMeta,
),
);
}
if (data.containsKey('seedbank_id')) {
context.handle(
_seedbankIdMeta,
seedbankId.isAcceptableOrUnknown(data['seedbank_id']!, _seedbankIdMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Lot map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Lot(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}updated_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
isDeleted: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_deleted'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
varietyId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}variety_id'],
)!,
harvestYear: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}harvest_year'],
),
quantityKind: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}quantity_kind'],
),
quantityPrecise: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}quantity_precise'],
),
quantityLabel: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}quantity_label'],
),
storageLocation: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}storage_location'],
),
offerStatus: $LotsTable.$converterofferStatus.fromSql(
attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}offer_status'],
)!,
),
seedbankId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}seedbank_id'],
),
);
}
@override
$LotsTable createAlias(String alias) {
return $LotsTable(attachedDatabase, alias);
}
static JsonTypeConverter2<OfferStatus, String, String> $converterofferStatus =
const EnumNameConverter<OfferStatus>(OfferStatus.values);
}
class Lot extends DataClass implements Insertable<Lot> {
final String id;
final int createdAt;
final String updatedAt;
final String lastAuthor;
final bool isDeleted;
final int schemaRowVersion;
final String varietyId;
final int? harvestYear;
final String? quantityKind;
final double? quantityPrecise;
final String? quantityLabel;
final String? storageLocation;
final OfferStatus offerStatus;
final String? seedbankId;
const Lot({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.lastAuthor,
required this.isDeleted,
required this.schemaRowVersion,
required this.varietyId,
this.harvestYear,
this.quantityKind,
this.quantityPrecise,
this.quantityLabel,
this.storageLocation,
required this.offerStatus,
this.seedbankId,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['updated_at'] = Variable<String>(updatedAt);
map['last_author'] = Variable<String>(lastAuthor);
map['is_deleted'] = Variable<bool>(isDeleted);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
map['variety_id'] = Variable<String>(varietyId);
if (!nullToAbsent || harvestYear != null) {
map['harvest_year'] = Variable<int>(harvestYear);
}
if (!nullToAbsent || quantityKind != null) {
map['quantity_kind'] = Variable<String>(quantityKind);
}
if (!nullToAbsent || quantityPrecise != null) {
map['quantity_precise'] = Variable<double>(quantityPrecise);
}
if (!nullToAbsent || quantityLabel != null) {
map['quantity_label'] = Variable<String>(quantityLabel);
}
if (!nullToAbsent || storageLocation != null) {
map['storage_location'] = Variable<String>(storageLocation);
}
{
map['offer_status'] = Variable<String>(
$LotsTable.$converterofferStatus.toSql(offerStatus),
);
}
if (!nullToAbsent || seedbankId != null) {
map['seedbank_id'] = Variable<String>(seedbankId);
}
return map;
}
LotsCompanion toCompanion(bool nullToAbsent) {
return LotsCompanion(
id: Value(id),
createdAt: Value(createdAt),
updatedAt: Value(updatedAt),
lastAuthor: Value(lastAuthor),
isDeleted: Value(isDeleted),
schemaRowVersion: Value(schemaRowVersion),
varietyId: Value(varietyId),
harvestYear: harvestYear == null && nullToAbsent
? const Value.absent()
: Value(harvestYear),
quantityKind: quantityKind == null && nullToAbsent
? const Value.absent()
: Value(quantityKind),
quantityPrecise: quantityPrecise == null && nullToAbsent
? const Value.absent()
: Value(quantityPrecise),
quantityLabel: quantityLabel == null && nullToAbsent
? const Value.absent()
: Value(quantityLabel),
storageLocation: storageLocation == null && nullToAbsent
? const Value.absent()
: Value(storageLocation),
offerStatus: Value(offerStatus),
seedbankId: seedbankId == null && nullToAbsent
? const Value.absent()
: Value(seedbankId),
);
}
factory Lot.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Lot(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
updatedAt: serializer.fromJson<String>(json['updatedAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
varietyId: serializer.fromJson<String>(json['varietyId']),
harvestYear: serializer.fromJson<int?>(json['harvestYear']),
quantityKind: serializer.fromJson<String?>(json['quantityKind']),
quantityPrecise: serializer.fromJson<double?>(json['quantityPrecise']),
quantityLabel: serializer.fromJson<String?>(json['quantityLabel']),
storageLocation: serializer.fromJson<String?>(json['storageLocation']),
offerStatus: $LotsTable.$converterofferStatus.fromJson(
serializer.fromJson<String>(json['offerStatus']),
),
seedbankId: serializer.fromJson<String?>(json['seedbankId']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'updatedAt': serializer.toJson<String>(updatedAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'isDeleted': serializer.toJson<bool>(isDeleted),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'varietyId': serializer.toJson<String>(varietyId),
'harvestYear': serializer.toJson<int?>(harvestYear),
'quantityKind': serializer.toJson<String?>(quantityKind),
'quantityPrecise': serializer.toJson<double?>(quantityPrecise),
'quantityLabel': serializer.toJson<String?>(quantityLabel),
'storageLocation': serializer.toJson<String?>(storageLocation),
'offerStatus': serializer.toJson<String>(
$LotsTable.$converterofferStatus.toJson(offerStatus),
),
'seedbankId': serializer.toJson<String?>(seedbankId),
};
}
Lot copyWith({
String? id,
int? createdAt,
String? updatedAt,
String? lastAuthor,
bool? isDeleted,
int? schemaRowVersion,
String? varietyId,
Value<int?> harvestYear = const Value.absent(),
Value<String?> quantityKind = const Value.absent(),
Value<double?> quantityPrecise = const Value.absent(),
Value<String?> quantityLabel = const Value.absent(),
Value<String?> storageLocation = const Value.absent(),
OfferStatus? offerStatus,
Value<String?> seedbankId = const Value.absent(),
}) => Lot(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
varietyId: varietyId ?? this.varietyId,
harvestYear: harvestYear.present ? harvestYear.value : this.harvestYear,
quantityKind: quantityKind.present ? quantityKind.value : this.quantityKind,
quantityPrecise: quantityPrecise.present
? quantityPrecise.value
: this.quantityPrecise,
quantityLabel: quantityLabel.present
? quantityLabel.value
: this.quantityLabel,
storageLocation: storageLocation.present
? storageLocation.value
: this.storageLocation,
offerStatus: offerStatus ?? this.offerStatus,
seedbankId: seedbankId.present ? seedbankId.value : this.seedbankId,
);
Lot copyWithCompanion(LotsCompanion data) {
return Lot(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
varietyId: data.varietyId.present ? data.varietyId.value : this.varietyId,
harvestYear: data.harvestYear.present
? data.harvestYear.value
: this.harvestYear,
quantityKind: data.quantityKind.present
? data.quantityKind.value
: this.quantityKind,
quantityPrecise: data.quantityPrecise.present
? data.quantityPrecise.value
: this.quantityPrecise,
quantityLabel: data.quantityLabel.present
? data.quantityLabel.value
: this.quantityLabel,
storageLocation: data.storageLocation.present
? data.storageLocation.value
: this.storageLocation,
offerStatus: data.offerStatus.present
? data.offerStatus.value
: this.offerStatus,
seedbankId: data.seedbankId.present
? data.seedbankId.value
: this.seedbankId,
);
}
@override
String toString() {
return (StringBuffer('Lot(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('varietyId: $varietyId, ')
..write('harvestYear: $harvestYear, ')
..write('quantityKind: $quantityKind, ')
..write('quantityPrecise: $quantityPrecise, ')
..write('quantityLabel: $quantityLabel, ')
..write('storageLocation: $storageLocation, ')
..write('offerStatus: $offerStatus, ')
..write('seedbankId: $seedbankId')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
varietyId,
harvestYear,
quantityKind,
quantityPrecise,
quantityLabel,
storageLocation,
offerStatus,
seedbankId,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Lot &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.updatedAt == this.updatedAt &&
other.lastAuthor == this.lastAuthor &&
other.isDeleted == this.isDeleted &&
other.schemaRowVersion == this.schemaRowVersion &&
other.varietyId == this.varietyId &&
other.harvestYear == this.harvestYear &&
other.quantityKind == this.quantityKind &&
other.quantityPrecise == this.quantityPrecise &&
other.quantityLabel == this.quantityLabel &&
other.storageLocation == this.storageLocation &&
other.offerStatus == this.offerStatus &&
other.seedbankId == this.seedbankId);
}
class LotsCompanion extends UpdateCompanion<Lot> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> updatedAt;
final Value<String> lastAuthor;
final Value<bool> isDeleted;
final Value<int> schemaRowVersion;
final Value<String> varietyId;
final Value<int?> harvestYear;
final Value<String?> quantityKind;
final Value<double?> quantityPrecise;
final Value<String?> quantityLabel;
final Value<String?> storageLocation;
final Value<OfferStatus> offerStatus;
final Value<String?> seedbankId;
final Value<int> rowid;
const LotsCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.updatedAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.varietyId = const Value.absent(),
this.harvestYear = const Value.absent(),
this.quantityKind = const Value.absent(),
this.quantityPrecise = const Value.absent(),
this.quantityLabel = const Value.absent(),
this.storageLocation = const Value.absent(),
this.offerStatus = const Value.absent(),
this.seedbankId = const Value.absent(),
this.rowid = const Value.absent(),
});
LotsCompanion.insert({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
required String varietyId,
this.harvestYear = const Value.absent(),
this.quantityKind = const Value.absent(),
this.quantityPrecise = const Value.absent(),
this.quantityLabel = const Value.absent(),
this.storageLocation = const Value.absent(),
this.offerStatus = const Value.absent(),
this.seedbankId = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
updatedAt = Value(updatedAt),
lastAuthor = Value(lastAuthor),
varietyId = Value(varietyId);
static Insertable<Lot> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? updatedAt,
Expression<String>? lastAuthor,
Expression<bool>? isDeleted,
Expression<int>? schemaRowVersion,
Expression<String>? varietyId,
Expression<int>? harvestYear,
Expression<String>? quantityKind,
Expression<double>? quantityPrecise,
Expression<String>? quantityLabel,
Expression<String>? storageLocation,
Expression<String>? offerStatus,
Expression<String>? seedbankId,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (updatedAt != null) 'updated_at': updatedAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (isDeleted != null) 'is_deleted': isDeleted,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (varietyId != null) 'variety_id': varietyId,
if (harvestYear != null) 'harvest_year': harvestYear,
if (quantityKind != null) 'quantity_kind': quantityKind,
if (quantityPrecise != null) 'quantity_precise': quantityPrecise,
if (quantityLabel != null) 'quantity_label': quantityLabel,
if (storageLocation != null) 'storage_location': storageLocation,
if (offerStatus != null) 'offer_status': offerStatus,
if (seedbankId != null) 'seedbank_id': seedbankId,
if (rowid != null) 'rowid': rowid,
});
}
LotsCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? updatedAt,
Value<String>? lastAuthor,
Value<bool>? isDeleted,
Value<int>? schemaRowVersion,
Value<String>? varietyId,
Value<int?>? harvestYear,
Value<String?>? quantityKind,
Value<double?>? quantityPrecise,
Value<String?>? quantityLabel,
Value<String?>? storageLocation,
Value<OfferStatus>? offerStatus,
Value<String?>? seedbankId,
Value<int>? rowid,
}) {
return LotsCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
varietyId: varietyId ?? this.varietyId,
harvestYear: harvestYear ?? this.harvestYear,
quantityKind: quantityKind ?? this.quantityKind,
quantityPrecise: quantityPrecise ?? this.quantityPrecise,
quantityLabel: quantityLabel ?? this.quantityLabel,
storageLocation: storageLocation ?? this.storageLocation,
offerStatus: offerStatus ?? this.offerStatus,
seedbankId: seedbankId ?? this.seedbankId,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<String>(updatedAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (isDeleted.present) {
map['is_deleted'] = Variable<bool>(isDeleted.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (varietyId.present) {
map['variety_id'] = Variable<String>(varietyId.value);
}
if (harvestYear.present) {
map['harvest_year'] = Variable<int>(harvestYear.value);
}
if (quantityKind.present) {
map['quantity_kind'] = Variable<String>(quantityKind.value);
}
if (quantityPrecise.present) {
map['quantity_precise'] = Variable<double>(quantityPrecise.value);
}
if (quantityLabel.present) {
map['quantity_label'] = Variable<String>(quantityLabel.value);
}
if (storageLocation.present) {
map['storage_location'] = Variable<String>(storageLocation.value);
}
if (offerStatus.present) {
map['offer_status'] = Variable<String>(
$LotsTable.$converterofferStatus.toSql(offerStatus.value),
);
}
if (seedbankId.present) {
map['seedbank_id'] = Variable<String>(seedbankId.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('LotsCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('varietyId: $varietyId, ')
..write('harvestYear: $harvestYear, ')
..write('quantityKind: $quantityKind, ')
..write('quantityPrecise: $quantityPrecise, ')
..write('quantityLabel: $quantityLabel, ')
..write('storageLocation: $storageLocation, ')
..write('offerStatus: $offerStatus, ')
..write('seedbankId: $seedbankId, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $GerminationTestsTable extends GerminationTests
with TableInfo<$GerminationTestsTable, GerminationTest> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$GerminationTestsTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
'isDeleted',
);
@override
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_deleted" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
static const VerificationMeta _lotIdMeta = const VerificationMeta('lotId');
@override
late final GeneratedColumn<String> lotId = GeneratedColumn<String>(
'lot_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _testedOnMeta = const VerificationMeta(
'testedOn',
);
@override
late final GeneratedColumn<int> testedOn = GeneratedColumn<int>(
'tested_on',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
);
static const VerificationMeta _sampleSizeMeta = const VerificationMeta(
'sampleSize',
);
@override
late final GeneratedColumn<int> sampleSize = GeneratedColumn<int>(
'sample_size',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
);
static const VerificationMeta _germinatedCountMeta = const VerificationMeta(
'germinatedCount',
);
@override
late final GeneratedColumn<int> germinatedCount = GeneratedColumn<int>(
'germinated_count',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
);
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
@override
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
'notes',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
lotId,
testedOn,
sampleSize,
germinatedCount,
notes,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'germination_tests';
@override
VerificationContext validateIntegrity(
Insertable<GerminationTest> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
} else if (isInserting) {
context.missing(_updatedAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('is_deleted')) {
context.handle(
_isDeletedMeta,
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('lot_id')) {
context.handle(
_lotIdMeta,
lotId.isAcceptableOrUnknown(data['lot_id']!, _lotIdMeta),
);
} else if (isInserting) {
context.missing(_lotIdMeta);
}
if (data.containsKey('tested_on')) {
context.handle(
_testedOnMeta,
testedOn.isAcceptableOrUnknown(data['tested_on']!, _testedOnMeta),
);
}
if (data.containsKey('sample_size')) {
context.handle(
_sampleSizeMeta,
sampleSize.isAcceptableOrUnknown(data['sample_size']!, _sampleSizeMeta),
);
}
if (data.containsKey('germinated_count')) {
context.handle(
_germinatedCountMeta,
germinatedCount.isAcceptableOrUnknown(
data['germinated_count']!,
_germinatedCountMeta,
),
);
}
if (data.containsKey('notes')) {
context.handle(
_notesMeta,
notes.isAcceptableOrUnknown(data['notes']!, _notesMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
GerminationTest map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return GerminationTest(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}updated_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
isDeleted: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_deleted'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
lotId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}lot_id'],
)!,
testedOn: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}tested_on'],
),
sampleSize: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}sample_size'],
),
germinatedCount: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}germinated_count'],
),
notes: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}notes'],
),
);
}
@override
$GerminationTestsTable createAlias(String alias) {
return $GerminationTestsTable(attachedDatabase, alias);
}
}
class GerminationTest extends DataClass implements Insertable<GerminationTest> {
final String id;
final int createdAt;
final String updatedAt;
final String lastAuthor;
final bool isDeleted;
final int schemaRowVersion;
final String lotId;
final int? testedOn;
final int? sampleSize;
final int? germinatedCount;
final String? notes;
const GerminationTest({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.lastAuthor,
required this.isDeleted,
required this.schemaRowVersion,
required this.lotId,
this.testedOn,
this.sampleSize,
this.germinatedCount,
this.notes,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['updated_at'] = Variable<String>(updatedAt);
map['last_author'] = Variable<String>(lastAuthor);
map['is_deleted'] = Variable<bool>(isDeleted);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
map['lot_id'] = Variable<String>(lotId);
if (!nullToAbsent || testedOn != null) {
map['tested_on'] = Variable<int>(testedOn);
}
if (!nullToAbsent || sampleSize != null) {
map['sample_size'] = Variable<int>(sampleSize);
}
if (!nullToAbsent || germinatedCount != null) {
map['germinated_count'] = Variable<int>(germinatedCount);
}
if (!nullToAbsent || notes != null) {
map['notes'] = Variable<String>(notes);
}
return map;
}
GerminationTestsCompanion toCompanion(bool nullToAbsent) {
return GerminationTestsCompanion(
id: Value(id),
createdAt: Value(createdAt),
updatedAt: Value(updatedAt),
lastAuthor: Value(lastAuthor),
isDeleted: Value(isDeleted),
schemaRowVersion: Value(schemaRowVersion),
lotId: Value(lotId),
testedOn: testedOn == null && nullToAbsent
? const Value.absent()
: Value(testedOn),
sampleSize: sampleSize == null && nullToAbsent
? const Value.absent()
: Value(sampleSize),
germinatedCount: germinatedCount == null && nullToAbsent
? const Value.absent()
: Value(germinatedCount),
notes: notes == null && nullToAbsent
? const Value.absent()
: Value(notes),
);
}
factory GerminationTest.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return GerminationTest(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
updatedAt: serializer.fromJson<String>(json['updatedAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
lotId: serializer.fromJson<String>(json['lotId']),
testedOn: serializer.fromJson<int?>(json['testedOn']),
sampleSize: serializer.fromJson<int?>(json['sampleSize']),
germinatedCount: serializer.fromJson<int?>(json['germinatedCount']),
notes: serializer.fromJson<String?>(json['notes']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'updatedAt': serializer.toJson<String>(updatedAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'isDeleted': serializer.toJson<bool>(isDeleted),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'lotId': serializer.toJson<String>(lotId),
'testedOn': serializer.toJson<int?>(testedOn),
'sampleSize': serializer.toJson<int?>(sampleSize),
'germinatedCount': serializer.toJson<int?>(germinatedCount),
'notes': serializer.toJson<String?>(notes),
};
}
GerminationTest copyWith({
String? id,
int? createdAt,
String? updatedAt,
String? lastAuthor,
bool? isDeleted,
int? schemaRowVersion,
String? lotId,
Value<int?> testedOn = const Value.absent(),
Value<int?> sampleSize = const Value.absent(),
Value<int?> germinatedCount = const Value.absent(),
Value<String?> notes = const Value.absent(),
}) => GerminationTest(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
lotId: lotId ?? this.lotId,
testedOn: testedOn.present ? testedOn.value : this.testedOn,
sampleSize: sampleSize.present ? sampleSize.value : this.sampleSize,
germinatedCount: germinatedCount.present
? germinatedCount.value
: this.germinatedCount,
notes: notes.present ? notes.value : this.notes,
);
GerminationTest copyWithCompanion(GerminationTestsCompanion data) {
return GerminationTest(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
lotId: data.lotId.present ? data.lotId.value : this.lotId,
testedOn: data.testedOn.present ? data.testedOn.value : this.testedOn,
sampleSize: data.sampleSize.present
? data.sampleSize.value
: this.sampleSize,
germinatedCount: data.germinatedCount.present
? data.germinatedCount.value
: this.germinatedCount,
notes: data.notes.present ? data.notes.value : this.notes,
);
}
@override
String toString() {
return (StringBuffer('GerminationTest(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('lotId: $lotId, ')
..write('testedOn: $testedOn, ')
..write('sampleSize: $sampleSize, ')
..write('germinatedCount: $germinatedCount, ')
..write('notes: $notes')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
lotId,
testedOn,
sampleSize,
germinatedCount,
notes,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is GerminationTest &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.updatedAt == this.updatedAt &&
other.lastAuthor == this.lastAuthor &&
other.isDeleted == this.isDeleted &&
other.schemaRowVersion == this.schemaRowVersion &&
other.lotId == this.lotId &&
other.testedOn == this.testedOn &&
other.sampleSize == this.sampleSize &&
other.germinatedCount == this.germinatedCount &&
other.notes == this.notes);
}
class GerminationTestsCompanion extends UpdateCompanion<GerminationTest> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> updatedAt;
final Value<String> lastAuthor;
final Value<bool> isDeleted;
final Value<int> schemaRowVersion;
final Value<String> lotId;
final Value<int?> testedOn;
final Value<int?> sampleSize;
final Value<int?> germinatedCount;
final Value<String?> notes;
final Value<int> rowid;
const GerminationTestsCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.updatedAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.lotId = const Value.absent(),
this.testedOn = const Value.absent(),
this.sampleSize = const Value.absent(),
this.germinatedCount = const Value.absent(),
this.notes = const Value.absent(),
this.rowid = const Value.absent(),
});
GerminationTestsCompanion.insert({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
required String lotId,
this.testedOn = const Value.absent(),
this.sampleSize = const Value.absent(),
this.germinatedCount = const Value.absent(),
this.notes = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
updatedAt = Value(updatedAt),
lastAuthor = Value(lastAuthor),
lotId = Value(lotId);
static Insertable<GerminationTest> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? updatedAt,
Expression<String>? lastAuthor,
Expression<bool>? isDeleted,
Expression<int>? schemaRowVersion,
Expression<String>? lotId,
Expression<int>? testedOn,
Expression<int>? sampleSize,
Expression<int>? germinatedCount,
Expression<String>? notes,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (updatedAt != null) 'updated_at': updatedAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (isDeleted != null) 'is_deleted': isDeleted,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (lotId != null) 'lot_id': lotId,
if (testedOn != null) 'tested_on': testedOn,
if (sampleSize != null) 'sample_size': sampleSize,
if (germinatedCount != null) 'germinated_count': germinatedCount,
if (notes != null) 'notes': notes,
if (rowid != null) 'rowid': rowid,
});
}
GerminationTestsCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? updatedAt,
Value<String>? lastAuthor,
Value<bool>? isDeleted,
Value<int>? schemaRowVersion,
Value<String>? lotId,
Value<int?>? testedOn,
Value<int?>? sampleSize,
Value<int?>? germinatedCount,
Value<String?>? notes,
Value<int>? rowid,
}) {
return GerminationTestsCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
lotId: lotId ?? this.lotId,
testedOn: testedOn ?? this.testedOn,
sampleSize: sampleSize ?? this.sampleSize,
germinatedCount: germinatedCount ?? this.germinatedCount,
notes: notes ?? this.notes,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<String>(updatedAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (isDeleted.present) {
map['is_deleted'] = Variable<bool>(isDeleted.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (lotId.present) {
map['lot_id'] = Variable<String>(lotId.value);
}
if (testedOn.present) {
map['tested_on'] = Variable<int>(testedOn.value);
}
if (sampleSize.present) {
map['sample_size'] = Variable<int>(sampleSize.value);
}
if (germinatedCount.present) {
map['germinated_count'] = Variable<int>(germinatedCount.value);
}
if (notes.present) {
map['notes'] = Variable<String>(notes.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('GerminationTestsCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('lotId: $lotId, ')
..write('testedOn: $testedOn, ')
..write('sampleSize: $sampleSize, ')
..write('germinatedCount: $germinatedCount, ')
..write('notes: $notes, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $MovementsTable extends Movements
with TableInfo<$MovementsTable, Movement> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$MovementsTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
static const VerificationMeta _lotIdMeta = const VerificationMeta('lotId');
@override
late final GeneratedColumn<String> lotId = GeneratedColumn<String>(
'lot_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
@override
late final GeneratedColumnWithTypeConverter<MovementType, String> type =
GeneratedColumn<String>(
'type',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
).withConverter<MovementType>($MovementsTable.$convertertype);
static const VerificationMeta _occurredOnMeta = const VerificationMeta(
'occurredOn',
);
@override
late final GeneratedColumn<int> occurredOn = GeneratedColumn<int>(
'occurred_on',
aliasedName,
true,
type: DriftSqlType.int,
requiredDuringInsert: false,
);
static const VerificationMeta _counterpartyIdMeta = const VerificationMeta(
'counterpartyId',
);
@override
late final GeneratedColumn<String> counterpartyId = GeneratedColumn<String>(
'counterparty_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _quantityKindMeta = const VerificationMeta(
'quantityKind',
);
@override
late final GeneratedColumn<String> quantityKind = GeneratedColumn<String>(
'quantity_kind',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _quantityPreciseMeta = const VerificationMeta(
'quantityPrecise',
);
@override
late final GeneratedColumn<double> quantityPrecise = GeneratedColumn<double>(
'quantity_precise',
aliasedName,
true,
type: DriftSqlType.double,
requiredDuringInsert: false,
);
static const VerificationMeta _quantityLabelMeta = const VerificationMeta(
'quantityLabel',
);
@override
late final GeneratedColumn<String> quantityLabel = GeneratedColumn<String>(
'quantity_label',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _parentMovementIdMeta = const VerificationMeta(
'parentMovementId',
);
@override
late final GeneratedColumn<String> parentMovementId = GeneratedColumn<String>(
'parent_movement_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _plantareIdMeta = const VerificationMeta(
'plantareId',
);
@override
late final GeneratedColumn<String> plantareId = GeneratedColumn<String>(
'plantare_id',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _notesMeta = const VerificationMeta('notes');
@override
late final GeneratedColumn<String> notes = GeneratedColumn<String>(
'notes',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
lastAuthor,
schemaRowVersion,
lotId,
type,
occurredOn,
counterpartyId,
quantityKind,
quantityPrecise,
quantityLabel,
parentMovementId,
plantareId,
notes,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'movements';
@override
VerificationContext validateIntegrity(
Insertable<Movement> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('lot_id')) {
context.handle(
_lotIdMeta,
lotId.isAcceptableOrUnknown(data['lot_id']!, _lotIdMeta),
);
} else if (isInserting) {
context.missing(_lotIdMeta);
}
if (data.containsKey('occurred_on')) {
context.handle(
_occurredOnMeta,
occurredOn.isAcceptableOrUnknown(data['occurred_on']!, _occurredOnMeta),
);
}
if (data.containsKey('counterparty_id')) {
context.handle(
_counterpartyIdMeta,
counterpartyId.isAcceptableOrUnknown(
data['counterparty_id']!,
_counterpartyIdMeta,
),
);
}
if (data.containsKey('quantity_kind')) {
context.handle(
_quantityKindMeta,
quantityKind.isAcceptableOrUnknown(
data['quantity_kind']!,
_quantityKindMeta,
),
);
}
if (data.containsKey('quantity_precise')) {
context.handle(
_quantityPreciseMeta,
quantityPrecise.isAcceptableOrUnknown(
data['quantity_precise']!,
_quantityPreciseMeta,
),
);
}
if (data.containsKey('quantity_label')) {
context.handle(
_quantityLabelMeta,
quantityLabel.isAcceptableOrUnknown(
data['quantity_label']!,
_quantityLabelMeta,
),
);
}
if (data.containsKey('parent_movement_id')) {
context.handle(
_parentMovementIdMeta,
parentMovementId.isAcceptableOrUnknown(
data['parent_movement_id']!,
_parentMovementIdMeta,
),
);
}
if (data.containsKey('plantare_id')) {
context.handle(
_plantareIdMeta,
plantareId.isAcceptableOrUnknown(data['plantare_id']!, _plantareIdMeta),
);
}
if (data.containsKey('notes')) {
context.handle(
_notesMeta,
notes.isAcceptableOrUnknown(data['notes']!, _notesMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Movement map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Movement(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
lotId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}lot_id'],
)!,
type: $MovementsTable.$convertertype.fromSql(
attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}type'],
)!,
),
occurredOn: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}occurred_on'],
),
counterpartyId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}counterparty_id'],
),
quantityKind: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}quantity_kind'],
),
quantityPrecise: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}quantity_precise'],
),
quantityLabel: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}quantity_label'],
),
parentMovementId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}parent_movement_id'],
),
plantareId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}plantare_id'],
),
notes: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}notes'],
),
);
}
@override
$MovementsTable createAlias(String alias) {
return $MovementsTable(attachedDatabase, alias);
}
static JsonTypeConverter2<MovementType, String, String> $convertertype =
const EnumNameConverter<MovementType>(MovementType.values);
}
class Movement extends DataClass implements Insertable<Movement> {
final String id;
final int createdAt;
final String lastAuthor;
final int schemaRowVersion;
final String lotId;
final MovementType type;
final int? occurredOn;
final String? counterpartyId;
final String? quantityKind;
final double? quantityPrecise;
final String? quantityLabel;
final String? parentMovementId;
final String? plantareId;
final String? notes;
const Movement({
required this.id,
required this.createdAt,
required this.lastAuthor,
required this.schemaRowVersion,
required this.lotId,
required this.type,
this.occurredOn,
this.counterpartyId,
this.quantityKind,
this.quantityPrecise,
this.quantityLabel,
this.parentMovementId,
this.plantareId,
this.notes,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['last_author'] = Variable<String>(lastAuthor);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
map['lot_id'] = Variable<String>(lotId);
{
map['type'] = Variable<String>(
$MovementsTable.$convertertype.toSql(type),
);
}
if (!nullToAbsent || occurredOn != null) {
map['occurred_on'] = Variable<int>(occurredOn);
}
if (!nullToAbsent || counterpartyId != null) {
map['counterparty_id'] = Variable<String>(counterpartyId);
}
if (!nullToAbsent || quantityKind != null) {
map['quantity_kind'] = Variable<String>(quantityKind);
}
if (!nullToAbsent || quantityPrecise != null) {
map['quantity_precise'] = Variable<double>(quantityPrecise);
}
if (!nullToAbsent || quantityLabel != null) {
map['quantity_label'] = Variable<String>(quantityLabel);
}
if (!nullToAbsent || parentMovementId != null) {
map['parent_movement_id'] = Variable<String>(parentMovementId);
}
if (!nullToAbsent || plantareId != null) {
map['plantare_id'] = Variable<String>(plantareId);
}
if (!nullToAbsent || notes != null) {
map['notes'] = Variable<String>(notes);
}
return map;
}
MovementsCompanion toCompanion(bool nullToAbsent) {
return MovementsCompanion(
id: Value(id),
createdAt: Value(createdAt),
lastAuthor: Value(lastAuthor),
schemaRowVersion: Value(schemaRowVersion),
lotId: Value(lotId),
type: Value(type),
occurredOn: occurredOn == null && nullToAbsent
? const Value.absent()
: Value(occurredOn),
counterpartyId: counterpartyId == null && nullToAbsent
? const Value.absent()
: Value(counterpartyId),
quantityKind: quantityKind == null && nullToAbsent
? const Value.absent()
: Value(quantityKind),
quantityPrecise: quantityPrecise == null && nullToAbsent
? const Value.absent()
: Value(quantityPrecise),
quantityLabel: quantityLabel == null && nullToAbsent
? const Value.absent()
: Value(quantityLabel),
parentMovementId: parentMovementId == null && nullToAbsent
? const Value.absent()
: Value(parentMovementId),
plantareId: plantareId == null && nullToAbsent
? const Value.absent()
: Value(plantareId),
notes: notes == null && nullToAbsent
? const Value.absent()
: Value(notes),
);
}
factory Movement.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Movement(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
lotId: serializer.fromJson<String>(json['lotId']),
type: $MovementsTable.$convertertype.fromJson(
serializer.fromJson<String>(json['type']),
),
occurredOn: serializer.fromJson<int?>(json['occurredOn']),
counterpartyId: serializer.fromJson<String?>(json['counterpartyId']),
quantityKind: serializer.fromJson<String?>(json['quantityKind']),
quantityPrecise: serializer.fromJson<double?>(json['quantityPrecise']),
quantityLabel: serializer.fromJson<String?>(json['quantityLabel']),
parentMovementId: serializer.fromJson<String?>(json['parentMovementId']),
plantareId: serializer.fromJson<String?>(json['plantareId']),
notes: serializer.fromJson<String?>(json['notes']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'lotId': serializer.toJson<String>(lotId),
'type': serializer.toJson<String>(
$MovementsTable.$convertertype.toJson(type),
),
'occurredOn': serializer.toJson<int?>(occurredOn),
'counterpartyId': serializer.toJson<String?>(counterpartyId),
'quantityKind': serializer.toJson<String?>(quantityKind),
'quantityPrecise': serializer.toJson<double?>(quantityPrecise),
'quantityLabel': serializer.toJson<String?>(quantityLabel),
'parentMovementId': serializer.toJson<String?>(parentMovementId),
'plantareId': serializer.toJson<String?>(plantareId),
'notes': serializer.toJson<String?>(notes),
};
}
Movement copyWith({
String? id,
int? createdAt,
String? lastAuthor,
int? schemaRowVersion,
String? lotId,
MovementType? type,
Value<int?> occurredOn = const Value.absent(),
Value<String?> counterpartyId = const Value.absent(),
Value<String?> quantityKind = const Value.absent(),
Value<double?> quantityPrecise = const Value.absent(),
Value<String?> quantityLabel = const Value.absent(),
Value<String?> parentMovementId = const Value.absent(),
Value<String?> plantareId = const Value.absent(),
Value<String?> notes = const Value.absent(),
}) => Movement(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
lotId: lotId ?? this.lotId,
type: type ?? this.type,
occurredOn: occurredOn.present ? occurredOn.value : this.occurredOn,
counterpartyId: counterpartyId.present
? counterpartyId.value
: this.counterpartyId,
quantityKind: quantityKind.present ? quantityKind.value : this.quantityKind,
quantityPrecise: quantityPrecise.present
? quantityPrecise.value
: this.quantityPrecise,
quantityLabel: quantityLabel.present
? quantityLabel.value
: this.quantityLabel,
parentMovementId: parentMovementId.present
? parentMovementId.value
: this.parentMovementId,
plantareId: plantareId.present ? plantareId.value : this.plantareId,
notes: notes.present ? notes.value : this.notes,
);
Movement copyWithCompanion(MovementsCompanion data) {
return Movement(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
lotId: data.lotId.present ? data.lotId.value : this.lotId,
type: data.type.present ? data.type.value : this.type,
occurredOn: data.occurredOn.present
? data.occurredOn.value
: this.occurredOn,
counterpartyId: data.counterpartyId.present
? data.counterpartyId.value
: this.counterpartyId,
quantityKind: data.quantityKind.present
? data.quantityKind.value
: this.quantityKind,
quantityPrecise: data.quantityPrecise.present
? data.quantityPrecise.value
: this.quantityPrecise,
quantityLabel: data.quantityLabel.present
? data.quantityLabel.value
: this.quantityLabel,
parentMovementId: data.parentMovementId.present
? data.parentMovementId.value
: this.parentMovementId,
plantareId: data.plantareId.present
? data.plantareId.value
: this.plantareId,
notes: data.notes.present ? data.notes.value : this.notes,
);
}
@override
String toString() {
return (StringBuffer('Movement(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('lotId: $lotId, ')
..write('type: $type, ')
..write('occurredOn: $occurredOn, ')
..write('counterpartyId: $counterpartyId, ')
..write('quantityKind: $quantityKind, ')
..write('quantityPrecise: $quantityPrecise, ')
..write('quantityLabel: $quantityLabel, ')
..write('parentMovementId: $parentMovementId, ')
..write('plantareId: $plantareId, ')
..write('notes: $notes')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
lastAuthor,
schemaRowVersion,
lotId,
type,
occurredOn,
counterpartyId,
quantityKind,
quantityPrecise,
quantityLabel,
parentMovementId,
plantareId,
notes,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Movement &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.lastAuthor == this.lastAuthor &&
other.schemaRowVersion == this.schemaRowVersion &&
other.lotId == this.lotId &&
other.type == this.type &&
other.occurredOn == this.occurredOn &&
other.counterpartyId == this.counterpartyId &&
other.quantityKind == this.quantityKind &&
other.quantityPrecise == this.quantityPrecise &&
other.quantityLabel == this.quantityLabel &&
other.parentMovementId == this.parentMovementId &&
other.plantareId == this.plantareId &&
other.notes == this.notes);
}
class MovementsCompanion extends UpdateCompanion<Movement> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> lastAuthor;
final Value<int> schemaRowVersion;
final Value<String> lotId;
final Value<MovementType> type;
final Value<int?> occurredOn;
final Value<String?> counterpartyId;
final Value<String?> quantityKind;
final Value<double?> quantityPrecise;
final Value<String?> quantityLabel;
final Value<String?> parentMovementId;
final Value<String?> plantareId;
final Value<String?> notes;
final Value<int> rowid;
const MovementsCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.lotId = const Value.absent(),
this.type = const Value.absent(),
this.occurredOn = const Value.absent(),
this.counterpartyId = const Value.absent(),
this.quantityKind = const Value.absent(),
this.quantityPrecise = const Value.absent(),
this.quantityLabel = const Value.absent(),
this.parentMovementId = const Value.absent(),
this.plantareId = const Value.absent(),
this.notes = const Value.absent(),
this.rowid = const Value.absent(),
});
MovementsCompanion.insert({
required String id,
required int createdAt,
required String lastAuthor,
this.schemaRowVersion = const Value.absent(),
required String lotId,
required MovementType type,
this.occurredOn = const Value.absent(),
this.counterpartyId = const Value.absent(),
this.quantityKind = const Value.absent(),
this.quantityPrecise = const Value.absent(),
this.quantityLabel = const Value.absent(),
this.parentMovementId = const Value.absent(),
this.plantareId = const Value.absent(),
this.notes = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
lastAuthor = Value(lastAuthor),
lotId = Value(lotId),
type = Value(type);
static Insertable<Movement> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? lastAuthor,
Expression<int>? schemaRowVersion,
Expression<String>? lotId,
Expression<String>? type,
Expression<int>? occurredOn,
Expression<String>? counterpartyId,
Expression<String>? quantityKind,
Expression<double>? quantityPrecise,
Expression<String>? quantityLabel,
Expression<String>? parentMovementId,
Expression<String>? plantareId,
Expression<String>? notes,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (lotId != null) 'lot_id': lotId,
if (type != null) 'type': type,
if (occurredOn != null) 'occurred_on': occurredOn,
if (counterpartyId != null) 'counterparty_id': counterpartyId,
if (quantityKind != null) 'quantity_kind': quantityKind,
if (quantityPrecise != null) 'quantity_precise': quantityPrecise,
if (quantityLabel != null) 'quantity_label': quantityLabel,
if (parentMovementId != null) 'parent_movement_id': parentMovementId,
if (plantareId != null) 'plantare_id': plantareId,
if (notes != null) 'notes': notes,
if (rowid != null) 'rowid': rowid,
});
}
MovementsCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? lastAuthor,
Value<int>? schemaRowVersion,
Value<String>? lotId,
Value<MovementType>? type,
Value<int?>? occurredOn,
Value<String?>? counterpartyId,
Value<String?>? quantityKind,
Value<double?>? quantityPrecise,
Value<String?>? quantityLabel,
Value<String?>? parentMovementId,
Value<String?>? plantareId,
Value<String?>? notes,
Value<int>? rowid,
}) {
return MovementsCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
lotId: lotId ?? this.lotId,
type: type ?? this.type,
occurredOn: occurredOn ?? this.occurredOn,
counterpartyId: counterpartyId ?? this.counterpartyId,
quantityKind: quantityKind ?? this.quantityKind,
quantityPrecise: quantityPrecise ?? this.quantityPrecise,
quantityLabel: quantityLabel ?? this.quantityLabel,
parentMovementId: parentMovementId ?? this.parentMovementId,
plantareId: plantareId ?? this.plantareId,
notes: notes ?? this.notes,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (lotId.present) {
map['lot_id'] = Variable<String>(lotId.value);
}
if (type.present) {
map['type'] = Variable<String>(
$MovementsTable.$convertertype.toSql(type.value),
);
}
if (occurredOn.present) {
map['occurred_on'] = Variable<int>(occurredOn.value);
}
if (counterpartyId.present) {
map['counterparty_id'] = Variable<String>(counterpartyId.value);
}
if (quantityKind.present) {
map['quantity_kind'] = Variable<String>(quantityKind.value);
}
if (quantityPrecise.present) {
map['quantity_precise'] = Variable<double>(quantityPrecise.value);
}
if (quantityLabel.present) {
map['quantity_label'] = Variable<String>(quantityLabel.value);
}
if (parentMovementId.present) {
map['parent_movement_id'] = Variable<String>(parentMovementId.value);
}
if (plantareId.present) {
map['plantare_id'] = Variable<String>(plantareId.value);
}
if (notes.present) {
map['notes'] = Variable<String>(notes.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('MovementsCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('lotId: $lotId, ')
..write('type: $type, ')
..write('occurredOn: $occurredOn, ')
..write('counterpartyId: $counterpartyId, ')
..write('quantityKind: $quantityKind, ')
..write('quantityPrecise: $quantityPrecise, ')
..write('quantityLabel: $quantityLabel, ')
..write('parentMovementId: $parentMovementId, ')
..write('plantareId: $plantareId, ')
..write('notes: $notes, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $PartiesTable extends Parties with TableInfo<$PartiesTable, Party> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$PartiesTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
'isDeleted',
);
@override
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_deleted" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
static const VerificationMeta _displayNameMeta = const VerificationMeta(
'displayName',
);
@override
late final GeneratedColumn<String> displayName = GeneratedColumn<String>(
'display_name',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _publicKeyMeta = const VerificationMeta(
'publicKey',
);
@override
late final GeneratedColumn<String> publicKey = GeneratedColumn<String>(
'public_key',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
late final GeneratedColumnWithTypeConverter<PartyKind, String> kind =
GeneratedColumn<String>(
'kind',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: false,
defaultValue: const Constant('person'),
).withConverter<PartyKind>($PartiesTable.$converterkind);
static const VerificationMeta _noteMeta = const VerificationMeta('note');
@override
late final GeneratedColumn<String> note = GeneratedColumn<String>(
'note',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
displayName,
publicKey,
kind,
note,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'parties';
@override
VerificationContext validateIntegrity(
Insertable<Party> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
} else if (isInserting) {
context.missing(_updatedAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('is_deleted')) {
context.handle(
_isDeletedMeta,
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('display_name')) {
context.handle(
_displayNameMeta,
displayName.isAcceptableOrUnknown(
data['display_name']!,
_displayNameMeta,
),
);
} else if (isInserting) {
context.missing(_displayNameMeta);
}
if (data.containsKey('public_key')) {
context.handle(
_publicKeyMeta,
publicKey.isAcceptableOrUnknown(data['public_key']!, _publicKeyMeta),
);
}
if (data.containsKey('note')) {
context.handle(
_noteMeta,
note.isAcceptableOrUnknown(data['note']!, _noteMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Party map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Party(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}updated_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
isDeleted: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_deleted'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
displayName: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}display_name'],
)!,
publicKey: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}public_key'],
),
kind: $PartiesTable.$converterkind.fromSql(
attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}kind'],
)!,
),
note: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}note'],
),
);
}
@override
$PartiesTable createAlias(String alias) {
return $PartiesTable(attachedDatabase, alias);
}
static JsonTypeConverter2<PartyKind, String, String> $converterkind =
const EnumNameConverter<PartyKind>(PartyKind.values);
}
class Party extends DataClass implements Insertable<Party> {
final String id;
final int createdAt;
final String updatedAt;
final String lastAuthor;
final bool isDeleted;
final int schemaRowVersion;
final String displayName;
final String? publicKey;
final PartyKind kind;
final String? note;
const Party({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.lastAuthor,
required this.isDeleted,
required this.schemaRowVersion,
required this.displayName,
this.publicKey,
required this.kind,
this.note,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['updated_at'] = Variable<String>(updatedAt);
map['last_author'] = Variable<String>(lastAuthor);
map['is_deleted'] = Variable<bool>(isDeleted);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
map['display_name'] = Variable<String>(displayName);
if (!nullToAbsent || publicKey != null) {
map['public_key'] = Variable<String>(publicKey);
}
{
map['kind'] = Variable<String>($PartiesTable.$converterkind.toSql(kind));
}
if (!nullToAbsent || note != null) {
map['note'] = Variable<String>(note);
}
return map;
}
PartiesCompanion toCompanion(bool nullToAbsent) {
return PartiesCompanion(
id: Value(id),
createdAt: Value(createdAt),
updatedAt: Value(updatedAt),
lastAuthor: Value(lastAuthor),
isDeleted: Value(isDeleted),
schemaRowVersion: Value(schemaRowVersion),
displayName: Value(displayName),
publicKey: publicKey == null && nullToAbsent
? const Value.absent()
: Value(publicKey),
kind: Value(kind),
note: note == null && nullToAbsent ? const Value.absent() : Value(note),
);
}
factory Party.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Party(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
updatedAt: serializer.fromJson<String>(json['updatedAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
displayName: serializer.fromJson<String>(json['displayName']),
publicKey: serializer.fromJson<String?>(json['publicKey']),
kind: $PartiesTable.$converterkind.fromJson(
serializer.fromJson<String>(json['kind']),
),
note: serializer.fromJson<String?>(json['note']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'updatedAt': serializer.toJson<String>(updatedAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'isDeleted': serializer.toJson<bool>(isDeleted),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'displayName': serializer.toJson<String>(displayName),
'publicKey': serializer.toJson<String?>(publicKey),
'kind': serializer.toJson<String>(
$PartiesTable.$converterkind.toJson(kind),
),
'note': serializer.toJson<String?>(note),
};
}
Party copyWith({
String? id,
int? createdAt,
String? updatedAt,
String? lastAuthor,
bool? isDeleted,
int? schemaRowVersion,
String? displayName,
Value<String?> publicKey = const Value.absent(),
PartyKind? kind,
Value<String?> note = const Value.absent(),
}) => Party(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
displayName: displayName ?? this.displayName,
publicKey: publicKey.present ? publicKey.value : this.publicKey,
kind: kind ?? this.kind,
note: note.present ? note.value : this.note,
);
Party copyWithCompanion(PartiesCompanion data) {
return Party(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
displayName: data.displayName.present
? data.displayName.value
: this.displayName,
publicKey: data.publicKey.present ? data.publicKey.value : this.publicKey,
kind: data.kind.present ? data.kind.value : this.kind,
note: data.note.present ? data.note.value : this.note,
);
}
@override
String toString() {
return (StringBuffer('Party(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('displayName: $displayName, ')
..write('publicKey: $publicKey, ')
..write('kind: $kind, ')
..write('note: $note')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
displayName,
publicKey,
kind,
note,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Party &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.updatedAt == this.updatedAt &&
other.lastAuthor == this.lastAuthor &&
other.isDeleted == this.isDeleted &&
other.schemaRowVersion == this.schemaRowVersion &&
other.displayName == this.displayName &&
other.publicKey == this.publicKey &&
other.kind == this.kind &&
other.note == this.note);
}
class PartiesCompanion extends UpdateCompanion<Party> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> updatedAt;
final Value<String> lastAuthor;
final Value<bool> isDeleted;
final Value<int> schemaRowVersion;
final Value<String> displayName;
final Value<String?> publicKey;
final Value<PartyKind> kind;
final Value<String?> note;
final Value<int> rowid;
const PartiesCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.updatedAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.displayName = const Value.absent(),
this.publicKey = const Value.absent(),
this.kind = const Value.absent(),
this.note = const Value.absent(),
this.rowid = const Value.absent(),
});
PartiesCompanion.insert({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
required String displayName,
this.publicKey = const Value.absent(),
this.kind = const Value.absent(),
this.note = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
updatedAt = Value(updatedAt),
lastAuthor = Value(lastAuthor),
displayName = Value(displayName);
static Insertable<Party> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? updatedAt,
Expression<String>? lastAuthor,
Expression<bool>? isDeleted,
Expression<int>? schemaRowVersion,
Expression<String>? displayName,
Expression<String>? publicKey,
Expression<String>? kind,
Expression<String>? note,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (updatedAt != null) 'updated_at': updatedAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (isDeleted != null) 'is_deleted': isDeleted,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (displayName != null) 'display_name': displayName,
if (publicKey != null) 'public_key': publicKey,
if (kind != null) 'kind': kind,
if (note != null) 'note': note,
if (rowid != null) 'rowid': rowid,
});
}
PartiesCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? updatedAt,
Value<String>? lastAuthor,
Value<bool>? isDeleted,
Value<int>? schemaRowVersion,
Value<String>? displayName,
Value<String?>? publicKey,
Value<PartyKind>? kind,
Value<String?>? note,
Value<int>? rowid,
}) {
return PartiesCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
displayName: displayName ?? this.displayName,
publicKey: publicKey ?? this.publicKey,
kind: kind ?? this.kind,
note: note ?? this.note,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<String>(updatedAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (isDeleted.present) {
map['is_deleted'] = Variable<bool>(isDeleted.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (displayName.present) {
map['display_name'] = Variable<String>(displayName.value);
}
if (publicKey.present) {
map['public_key'] = Variable<String>(publicKey.value);
}
if (kind.present) {
map['kind'] = Variable<String>(
$PartiesTable.$converterkind.toSql(kind.value),
);
}
if (note.present) {
map['note'] = Variable<String>(note.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('PartiesCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('displayName: $displayName, ')
..write('publicKey: $publicKey, ')
..write('kind: $kind, ')
..write('note: $note, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $AttachmentsTable extends Attachments
with TableInfo<$AttachmentsTable, Attachment> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$AttachmentsTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
'isDeleted',
);
@override
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_deleted" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
@override
late final GeneratedColumnWithTypeConverter<ParentType, String> parentType =
GeneratedColumn<String>(
'parent_type',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
).withConverter<ParentType>($AttachmentsTable.$converterparentType);
static const VerificationMeta _parentIdMeta = const VerificationMeta(
'parentId',
);
@override
late final GeneratedColumn<String> parentId = GeneratedColumn<String>(
'parent_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
@override
late final GeneratedColumnWithTypeConverter<AttachmentKind, String> kind =
GeneratedColumn<String>(
'kind',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
).withConverter<AttachmentKind>($AttachmentsTable.$converterkind);
static const VerificationMeta _uriMeta = const VerificationMeta('uri');
@override
late final GeneratedColumn<String> uri = GeneratedColumn<String>(
'uri',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
static const VerificationMeta _bytesMeta = const VerificationMeta('bytes');
@override
late final GeneratedColumn<Uint8List> bytes = GeneratedColumn<Uint8List>(
'bytes',
aliasedName,
true,
type: DriftSqlType.blob,
requiredDuringInsert: false,
);
static const VerificationMeta _mimeTypeMeta = const VerificationMeta(
'mimeType',
);
@override
late final GeneratedColumn<String> mimeType = GeneratedColumn<String>(
'mime_type',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
parentType,
parentId,
kind,
uri,
bytes,
mimeType,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'attachments';
@override
VerificationContext validateIntegrity(
Insertable<Attachment> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
} else if (isInserting) {
context.missing(_updatedAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('is_deleted')) {
context.handle(
_isDeletedMeta,
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('parent_id')) {
context.handle(
_parentIdMeta,
parentId.isAcceptableOrUnknown(data['parent_id']!, _parentIdMeta),
);
} else if (isInserting) {
context.missing(_parentIdMeta);
}
if (data.containsKey('uri')) {
context.handle(
_uriMeta,
uri.isAcceptableOrUnknown(data['uri']!, _uriMeta),
);
}
if (data.containsKey('bytes')) {
context.handle(
_bytesMeta,
bytes.isAcceptableOrUnknown(data['bytes']!, _bytesMeta),
);
}
if (data.containsKey('mime_type')) {
context.handle(
_mimeTypeMeta,
mimeType.isAcceptableOrUnknown(data['mime_type']!, _mimeTypeMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
Attachment map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Attachment(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}updated_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
isDeleted: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_deleted'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
parentType: $AttachmentsTable.$converterparentType.fromSql(
attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}parent_type'],
)!,
),
parentId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}parent_id'],
)!,
kind: $AttachmentsTable.$converterkind.fromSql(
attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}kind'],
)!,
),
uri: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}uri'],
),
bytes: attachedDatabase.typeMapping.read(
DriftSqlType.blob,
data['${effectivePrefix}bytes'],
),
mimeType: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}mime_type'],
),
);
}
@override
$AttachmentsTable createAlias(String alias) {
return $AttachmentsTable(attachedDatabase, alias);
}
static JsonTypeConverter2<ParentType, String, String> $converterparentType =
const EnumNameConverter<ParentType>(ParentType.values);
static JsonTypeConverter2<AttachmentKind, String, String> $converterkind =
const EnumNameConverter<AttachmentKind>(AttachmentKind.values);
}
class Attachment extends DataClass implements Insertable<Attachment> {
final String id;
final int createdAt;
final String updatedAt;
final String lastAuthor;
final bool isDeleted;
final int schemaRowVersion;
final ParentType parentType;
final String parentId;
final AttachmentKind kind;
final String? uri;
final Uint8List? bytes;
final String? mimeType;
const Attachment({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.lastAuthor,
required this.isDeleted,
required this.schemaRowVersion,
required this.parentType,
required this.parentId,
required this.kind,
this.uri,
this.bytes,
this.mimeType,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['updated_at'] = Variable<String>(updatedAt);
map['last_author'] = Variable<String>(lastAuthor);
map['is_deleted'] = Variable<bool>(isDeleted);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
{
map['parent_type'] = Variable<String>(
$AttachmentsTable.$converterparentType.toSql(parentType),
);
}
map['parent_id'] = Variable<String>(parentId);
{
map['kind'] = Variable<String>(
$AttachmentsTable.$converterkind.toSql(kind),
);
}
if (!nullToAbsent || uri != null) {
map['uri'] = Variable<String>(uri);
}
if (!nullToAbsent || bytes != null) {
map['bytes'] = Variable<Uint8List>(bytes);
}
if (!nullToAbsent || mimeType != null) {
map['mime_type'] = Variable<String>(mimeType);
}
return map;
}
AttachmentsCompanion toCompanion(bool nullToAbsent) {
return AttachmentsCompanion(
id: Value(id),
createdAt: Value(createdAt),
updatedAt: Value(updatedAt),
lastAuthor: Value(lastAuthor),
isDeleted: Value(isDeleted),
schemaRowVersion: Value(schemaRowVersion),
parentType: Value(parentType),
parentId: Value(parentId),
kind: Value(kind),
uri: uri == null && nullToAbsent ? const Value.absent() : Value(uri),
bytes: bytes == null && nullToAbsent
? const Value.absent()
: Value(bytes),
mimeType: mimeType == null && nullToAbsent
? const Value.absent()
: Value(mimeType),
);
}
factory Attachment.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return Attachment(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
updatedAt: serializer.fromJson<String>(json['updatedAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
parentType: $AttachmentsTable.$converterparentType.fromJson(
serializer.fromJson<String>(json['parentType']),
),
parentId: serializer.fromJson<String>(json['parentId']),
kind: $AttachmentsTable.$converterkind.fromJson(
serializer.fromJson<String>(json['kind']),
),
uri: serializer.fromJson<String?>(json['uri']),
bytes: serializer.fromJson<Uint8List?>(json['bytes']),
mimeType: serializer.fromJson<String?>(json['mimeType']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'updatedAt': serializer.toJson<String>(updatedAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'isDeleted': serializer.toJson<bool>(isDeleted),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'parentType': serializer.toJson<String>(
$AttachmentsTable.$converterparentType.toJson(parentType),
),
'parentId': serializer.toJson<String>(parentId),
'kind': serializer.toJson<String>(
$AttachmentsTable.$converterkind.toJson(kind),
),
'uri': serializer.toJson<String?>(uri),
'bytes': serializer.toJson<Uint8List?>(bytes),
'mimeType': serializer.toJson<String?>(mimeType),
};
}
Attachment copyWith({
String? id,
int? createdAt,
String? updatedAt,
String? lastAuthor,
bool? isDeleted,
int? schemaRowVersion,
ParentType? parentType,
String? parentId,
AttachmentKind? kind,
Value<String?> uri = const Value.absent(),
Value<Uint8List?> bytes = const Value.absent(),
Value<String?> mimeType = const Value.absent(),
}) => Attachment(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
parentType: parentType ?? this.parentType,
parentId: parentId ?? this.parentId,
kind: kind ?? this.kind,
uri: uri.present ? uri.value : this.uri,
bytes: bytes.present ? bytes.value : this.bytes,
mimeType: mimeType.present ? mimeType.value : this.mimeType,
);
Attachment copyWithCompanion(AttachmentsCompanion data) {
return Attachment(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
parentType: data.parentType.present
? data.parentType.value
: this.parentType,
parentId: data.parentId.present ? data.parentId.value : this.parentId,
kind: data.kind.present ? data.kind.value : this.kind,
uri: data.uri.present ? data.uri.value : this.uri,
bytes: data.bytes.present ? data.bytes.value : this.bytes,
mimeType: data.mimeType.present ? data.mimeType.value : this.mimeType,
);
}
@override
String toString() {
return (StringBuffer('Attachment(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('parentType: $parentType, ')
..write('parentId: $parentId, ')
..write('kind: $kind, ')
..write('uri: $uri, ')
..write('bytes: $bytes, ')
..write('mimeType: $mimeType')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
parentType,
parentId,
kind,
uri,
$driftBlobEquality.hash(bytes),
mimeType,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is Attachment &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.updatedAt == this.updatedAt &&
other.lastAuthor == this.lastAuthor &&
other.isDeleted == this.isDeleted &&
other.schemaRowVersion == this.schemaRowVersion &&
other.parentType == this.parentType &&
other.parentId == this.parentId &&
other.kind == this.kind &&
other.uri == this.uri &&
$driftBlobEquality.equals(other.bytes, this.bytes) &&
other.mimeType == this.mimeType);
}
class AttachmentsCompanion extends UpdateCompanion<Attachment> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> updatedAt;
final Value<String> lastAuthor;
final Value<bool> isDeleted;
final Value<int> schemaRowVersion;
final Value<ParentType> parentType;
final Value<String> parentId;
final Value<AttachmentKind> kind;
final Value<String?> uri;
final Value<Uint8List?> bytes;
final Value<String?> mimeType;
final Value<int> rowid;
const AttachmentsCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.updatedAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.parentType = const Value.absent(),
this.parentId = const Value.absent(),
this.kind = const Value.absent(),
this.uri = const Value.absent(),
this.bytes = const Value.absent(),
this.mimeType = const Value.absent(),
this.rowid = const Value.absent(),
});
AttachmentsCompanion.insert({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
required ParentType parentType,
required String parentId,
required AttachmentKind kind,
this.uri = const Value.absent(),
this.bytes = const Value.absent(),
this.mimeType = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
updatedAt = Value(updatedAt),
lastAuthor = Value(lastAuthor),
parentType = Value(parentType),
parentId = Value(parentId),
kind = Value(kind);
static Insertable<Attachment> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? updatedAt,
Expression<String>? lastAuthor,
Expression<bool>? isDeleted,
Expression<int>? schemaRowVersion,
Expression<String>? parentType,
Expression<String>? parentId,
Expression<String>? kind,
Expression<String>? uri,
Expression<Uint8List>? bytes,
Expression<String>? mimeType,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (updatedAt != null) 'updated_at': updatedAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (isDeleted != null) 'is_deleted': isDeleted,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (parentType != null) 'parent_type': parentType,
if (parentId != null) 'parent_id': parentId,
if (kind != null) 'kind': kind,
if (uri != null) 'uri': uri,
if (bytes != null) 'bytes': bytes,
if (mimeType != null) 'mime_type': mimeType,
if (rowid != null) 'rowid': rowid,
});
}
AttachmentsCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? updatedAt,
Value<String>? lastAuthor,
Value<bool>? isDeleted,
Value<int>? schemaRowVersion,
Value<ParentType>? parentType,
Value<String>? parentId,
Value<AttachmentKind>? kind,
Value<String?>? uri,
Value<Uint8List?>? bytes,
Value<String?>? mimeType,
Value<int>? rowid,
}) {
return AttachmentsCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
parentType: parentType ?? this.parentType,
parentId: parentId ?? this.parentId,
kind: kind ?? this.kind,
uri: uri ?? this.uri,
bytes: bytes ?? this.bytes,
mimeType: mimeType ?? this.mimeType,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<String>(updatedAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (isDeleted.present) {
map['is_deleted'] = Variable<bool>(isDeleted.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (parentType.present) {
map['parent_type'] = Variable<String>(
$AttachmentsTable.$converterparentType.toSql(parentType.value),
);
}
if (parentId.present) {
map['parent_id'] = Variable<String>(parentId.value);
}
if (kind.present) {
map['kind'] = Variable<String>(
$AttachmentsTable.$converterkind.toSql(kind.value),
);
}
if (uri.present) {
map['uri'] = Variable<String>(uri.value);
}
if (bytes.present) {
map['bytes'] = Variable<Uint8List>(bytes.value);
}
if (mimeType.present) {
map['mime_type'] = Variable<String>(mimeType.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('AttachmentsCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('parentType: $parentType, ')
..write('parentId: $parentId, ')
..write('kind: $kind, ')
..write('uri: $uri, ')
..write('bytes: $bytes, ')
..write('mimeType: $mimeType, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
class $ExternalLinksTable extends ExternalLinks
with TableInfo<$ExternalLinksTable, ExternalLink> {
@override
final GeneratedDatabase attachedDatabase;
final String? _alias;
$ExternalLinksTable(this.attachedDatabase, [this._alias]);
static const VerificationMeta _idMeta = const VerificationMeta('id');
@override
late final GeneratedColumn<String> id = GeneratedColumn<String>(
'id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _createdAtMeta = const VerificationMeta(
'createdAt',
);
@override
late final GeneratedColumn<int> createdAt = GeneratedColumn<int>(
'created_at',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: true,
);
static const VerificationMeta _updatedAtMeta = const VerificationMeta(
'updatedAt',
);
@override
late final GeneratedColumn<String> updatedAt = GeneratedColumn<String>(
'updated_at',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _lastAuthorMeta = const VerificationMeta(
'lastAuthor',
);
@override
late final GeneratedColumn<String> lastAuthor = GeneratedColumn<String>(
'last_author',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _isDeletedMeta = const VerificationMeta(
'isDeleted',
);
@override
late final GeneratedColumn<bool> isDeleted = GeneratedColumn<bool>(
'is_deleted',
aliasedName,
false,
type: DriftSqlType.bool,
requiredDuringInsert: false,
defaultConstraints: GeneratedColumn.constraintIsAlways(
'CHECK ("is_deleted" IN (0, 1))',
),
defaultValue: const Constant(false),
);
static const VerificationMeta _schemaRowVersionMeta = const VerificationMeta(
'schemaRowVersion',
);
@override
late final GeneratedColumn<int> schemaRowVersion = GeneratedColumn<int>(
'schema_row_version',
aliasedName,
false,
type: DriftSqlType.int,
requiredDuringInsert: false,
defaultValue: const Constant(1),
);
@override
late final GeneratedColumnWithTypeConverter<ParentType, String> parentType =
GeneratedColumn<String>(
'parent_type',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
).withConverter<ParentType>($ExternalLinksTable.$converterparentType);
static const VerificationMeta _parentIdMeta = const VerificationMeta(
'parentId',
);
@override
late final GeneratedColumn<String> parentId = GeneratedColumn<String>(
'parent_id',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _urlMeta = const VerificationMeta('url');
@override
late final GeneratedColumn<String> url = GeneratedColumn<String>(
'url',
aliasedName,
false,
type: DriftSqlType.string,
requiredDuringInsert: true,
);
static const VerificationMeta _titleMeta = const VerificationMeta('title');
@override
late final GeneratedColumn<String> title = GeneratedColumn<String>(
'title',
aliasedName,
true,
type: DriftSqlType.string,
requiredDuringInsert: false,
);
@override
List<GeneratedColumn> get $columns => [
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
parentType,
parentId,
url,
title,
];
@override
String get aliasedName => _alias ?? actualTableName;
@override
String get actualTableName => $name;
static const String $name = 'external_links';
@override
VerificationContext validateIntegrity(
Insertable<ExternalLink> instance, {
bool isInserting = false,
}) {
final context = VerificationContext();
final data = instance.toColumns(true);
if (data.containsKey('id')) {
context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta));
} else if (isInserting) {
context.missing(_idMeta);
}
if (data.containsKey('created_at')) {
context.handle(
_createdAtMeta,
createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta),
);
} else if (isInserting) {
context.missing(_createdAtMeta);
}
if (data.containsKey('updated_at')) {
context.handle(
_updatedAtMeta,
updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta),
);
} else if (isInserting) {
context.missing(_updatedAtMeta);
}
if (data.containsKey('last_author')) {
context.handle(
_lastAuthorMeta,
lastAuthor.isAcceptableOrUnknown(data['last_author']!, _lastAuthorMeta),
);
} else if (isInserting) {
context.missing(_lastAuthorMeta);
}
if (data.containsKey('is_deleted')) {
context.handle(
_isDeletedMeta,
isDeleted.isAcceptableOrUnknown(data['is_deleted']!, _isDeletedMeta),
);
}
if (data.containsKey('schema_row_version')) {
context.handle(
_schemaRowVersionMeta,
schemaRowVersion.isAcceptableOrUnknown(
data['schema_row_version']!,
_schemaRowVersionMeta,
),
);
}
if (data.containsKey('parent_id')) {
context.handle(
_parentIdMeta,
parentId.isAcceptableOrUnknown(data['parent_id']!, _parentIdMeta),
);
} else if (isInserting) {
context.missing(_parentIdMeta);
}
if (data.containsKey('url')) {
context.handle(
_urlMeta,
url.isAcceptableOrUnknown(data['url']!, _urlMeta),
);
} else if (isInserting) {
context.missing(_urlMeta);
}
if (data.containsKey('title')) {
context.handle(
_titleMeta,
title.isAcceptableOrUnknown(data['title']!, _titleMeta),
);
}
return context;
}
@override
Set<GeneratedColumn> get $primaryKey => {id};
@override
ExternalLink map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return ExternalLink(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
createdAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}created_at'],
)!,
updatedAt: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}updated_at'],
)!,
lastAuthor: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}last_author'],
)!,
isDeleted: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_deleted'],
)!,
schemaRowVersion: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}schema_row_version'],
)!,
parentType: $ExternalLinksTable.$converterparentType.fromSql(
attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}parent_type'],
)!,
),
parentId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}parent_id'],
)!,
url: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}url'],
)!,
title: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}title'],
),
);
}
@override
$ExternalLinksTable createAlias(String alias) {
return $ExternalLinksTable(attachedDatabase, alias);
}
static JsonTypeConverter2<ParentType, String, String> $converterparentType =
const EnumNameConverter<ParentType>(ParentType.values);
}
class ExternalLink extends DataClass implements Insertable<ExternalLink> {
final String id;
final int createdAt;
final String updatedAt;
final String lastAuthor;
final bool isDeleted;
final int schemaRowVersion;
final ParentType parentType;
final String parentId;
final String url;
final String? title;
const ExternalLink({
required this.id,
required this.createdAt,
required this.updatedAt,
required this.lastAuthor,
required this.isDeleted,
required this.schemaRowVersion,
required this.parentType,
required this.parentId,
required this.url,
this.title,
});
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['created_at'] = Variable<int>(createdAt);
map['updated_at'] = Variable<String>(updatedAt);
map['last_author'] = Variable<String>(lastAuthor);
map['is_deleted'] = Variable<bool>(isDeleted);
map['schema_row_version'] = Variable<int>(schemaRowVersion);
{
map['parent_type'] = Variable<String>(
$ExternalLinksTable.$converterparentType.toSql(parentType),
);
}
map['parent_id'] = Variable<String>(parentId);
map['url'] = Variable<String>(url);
if (!nullToAbsent || title != null) {
map['title'] = Variable<String>(title);
}
return map;
}
ExternalLinksCompanion toCompanion(bool nullToAbsent) {
return ExternalLinksCompanion(
id: Value(id),
createdAt: Value(createdAt),
updatedAt: Value(updatedAt),
lastAuthor: Value(lastAuthor),
isDeleted: Value(isDeleted),
schemaRowVersion: Value(schemaRowVersion),
parentType: Value(parentType),
parentId: Value(parentId),
url: Value(url),
title: title == null && nullToAbsent
? const Value.absent()
: Value(title),
);
}
factory ExternalLink.fromJson(
Map<String, dynamic> json, {
ValueSerializer? serializer,
}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return ExternalLink(
id: serializer.fromJson<String>(json['id']),
createdAt: serializer.fromJson<int>(json['createdAt']),
updatedAt: serializer.fromJson<String>(json['updatedAt']),
lastAuthor: serializer.fromJson<String>(json['lastAuthor']),
isDeleted: serializer.fromJson<bool>(json['isDeleted']),
schemaRowVersion: serializer.fromJson<int>(json['schemaRowVersion']),
parentType: $ExternalLinksTable.$converterparentType.fromJson(
serializer.fromJson<String>(json['parentType']),
),
parentId: serializer.fromJson<String>(json['parentId']),
url: serializer.fromJson<String>(json['url']),
title: serializer.fromJson<String?>(json['title']),
);
}
@override
Map<String, dynamic> toJson({ValueSerializer? serializer}) {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'createdAt': serializer.toJson<int>(createdAt),
'updatedAt': serializer.toJson<String>(updatedAt),
'lastAuthor': serializer.toJson<String>(lastAuthor),
'isDeleted': serializer.toJson<bool>(isDeleted),
'schemaRowVersion': serializer.toJson<int>(schemaRowVersion),
'parentType': serializer.toJson<String>(
$ExternalLinksTable.$converterparentType.toJson(parentType),
),
'parentId': serializer.toJson<String>(parentId),
'url': serializer.toJson<String>(url),
'title': serializer.toJson<String?>(title),
};
}
ExternalLink copyWith({
String? id,
int? createdAt,
String? updatedAt,
String? lastAuthor,
bool? isDeleted,
int? schemaRowVersion,
ParentType? parentType,
String? parentId,
String? url,
Value<String?> title = const Value.absent(),
}) => ExternalLink(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
parentType: parentType ?? this.parentType,
parentId: parentId ?? this.parentId,
url: url ?? this.url,
title: title.present ? title.value : this.title,
);
ExternalLink copyWithCompanion(ExternalLinksCompanion data) {
return ExternalLink(
id: data.id.present ? data.id.value : this.id,
createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt,
updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt,
lastAuthor: data.lastAuthor.present
? data.lastAuthor.value
: this.lastAuthor,
isDeleted: data.isDeleted.present ? data.isDeleted.value : this.isDeleted,
schemaRowVersion: data.schemaRowVersion.present
? data.schemaRowVersion.value
: this.schemaRowVersion,
parentType: data.parentType.present
? data.parentType.value
: this.parentType,
parentId: data.parentId.present ? data.parentId.value : this.parentId,
url: data.url.present ? data.url.value : this.url,
title: data.title.present ? data.title.value : this.title,
);
}
@override
String toString() {
return (StringBuffer('ExternalLink(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('parentType: $parentType, ')
..write('parentId: $parentId, ')
..write('url: $url, ')
..write('title: $title')
..write(')'))
.toString();
}
@override
int get hashCode => Object.hash(
id,
createdAt,
updatedAt,
lastAuthor,
isDeleted,
schemaRowVersion,
parentType,
parentId,
url,
title,
);
@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is ExternalLink &&
other.id == this.id &&
other.createdAt == this.createdAt &&
other.updatedAt == this.updatedAt &&
other.lastAuthor == this.lastAuthor &&
other.isDeleted == this.isDeleted &&
other.schemaRowVersion == this.schemaRowVersion &&
other.parentType == this.parentType &&
other.parentId == this.parentId &&
other.url == this.url &&
other.title == this.title);
}
class ExternalLinksCompanion extends UpdateCompanion<ExternalLink> {
final Value<String> id;
final Value<int> createdAt;
final Value<String> updatedAt;
final Value<String> lastAuthor;
final Value<bool> isDeleted;
final Value<int> schemaRowVersion;
final Value<ParentType> parentType;
final Value<String> parentId;
final Value<String> url;
final Value<String?> title;
final Value<int> rowid;
const ExternalLinksCompanion({
this.id = const Value.absent(),
this.createdAt = const Value.absent(),
this.updatedAt = const Value.absent(),
this.lastAuthor = const Value.absent(),
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
this.parentType = const Value.absent(),
this.parentId = const Value.absent(),
this.url = const Value.absent(),
this.title = const Value.absent(),
this.rowid = const Value.absent(),
});
ExternalLinksCompanion.insert({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
this.isDeleted = const Value.absent(),
this.schemaRowVersion = const Value.absent(),
required ParentType parentType,
required String parentId,
required String url,
this.title = const Value.absent(),
this.rowid = const Value.absent(),
}) : id = Value(id),
createdAt = Value(createdAt),
updatedAt = Value(updatedAt),
lastAuthor = Value(lastAuthor),
parentType = Value(parentType),
parentId = Value(parentId),
url = Value(url);
static Insertable<ExternalLink> custom({
Expression<String>? id,
Expression<int>? createdAt,
Expression<String>? updatedAt,
Expression<String>? lastAuthor,
Expression<bool>? isDeleted,
Expression<int>? schemaRowVersion,
Expression<String>? parentType,
Expression<String>? parentId,
Expression<String>? url,
Expression<String>? title,
Expression<int>? rowid,
}) {
return RawValuesInsertable({
if (id != null) 'id': id,
if (createdAt != null) 'created_at': createdAt,
if (updatedAt != null) 'updated_at': updatedAt,
if (lastAuthor != null) 'last_author': lastAuthor,
if (isDeleted != null) 'is_deleted': isDeleted,
if (schemaRowVersion != null) 'schema_row_version': schemaRowVersion,
if (parentType != null) 'parent_type': parentType,
if (parentId != null) 'parent_id': parentId,
if (url != null) 'url': url,
if (title != null) 'title': title,
if (rowid != null) 'rowid': rowid,
});
}
ExternalLinksCompanion copyWith({
Value<String>? id,
Value<int>? createdAt,
Value<String>? updatedAt,
Value<String>? lastAuthor,
Value<bool>? isDeleted,
Value<int>? schemaRowVersion,
Value<ParentType>? parentType,
Value<String>? parentId,
Value<String>? url,
Value<String?>? title,
Value<int>? rowid,
}) {
return ExternalLinksCompanion(
id: id ?? this.id,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt,
lastAuthor: lastAuthor ?? this.lastAuthor,
isDeleted: isDeleted ?? this.isDeleted,
schemaRowVersion: schemaRowVersion ?? this.schemaRowVersion,
parentType: parentType ?? this.parentType,
parentId: parentId ?? this.parentId,
url: url ?? this.url,
title: title ?? this.title,
rowid: rowid ?? this.rowid,
);
}
@override
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
if (id.present) {
map['id'] = Variable<String>(id.value);
}
if (createdAt.present) {
map['created_at'] = Variable<int>(createdAt.value);
}
if (updatedAt.present) {
map['updated_at'] = Variable<String>(updatedAt.value);
}
if (lastAuthor.present) {
map['last_author'] = Variable<String>(lastAuthor.value);
}
if (isDeleted.present) {
map['is_deleted'] = Variable<bool>(isDeleted.value);
}
if (schemaRowVersion.present) {
map['schema_row_version'] = Variable<int>(schemaRowVersion.value);
}
if (parentType.present) {
map['parent_type'] = Variable<String>(
$ExternalLinksTable.$converterparentType.toSql(parentType.value),
);
}
if (parentId.present) {
map['parent_id'] = Variable<String>(parentId.value);
}
if (url.present) {
map['url'] = Variable<String>(url.value);
}
if (title.present) {
map['title'] = Variable<String>(title.value);
}
if (rowid.present) {
map['rowid'] = Variable<int>(rowid.value);
}
return map;
}
@override
String toString() {
return (StringBuffer('ExternalLinksCompanion(')
..write('id: $id, ')
..write('createdAt: $createdAt, ')
..write('updatedAt: $updatedAt, ')
..write('lastAuthor: $lastAuthor, ')
..write('isDeleted: $isDeleted, ')
..write('schemaRowVersion: $schemaRowVersion, ')
..write('parentType: $parentType, ')
..write('parentId: $parentId, ')
..write('url: $url, ')
..write('title: $title, ')
..write('rowid: $rowid')
..write(')'))
.toString();
}
}
abstract class _$AppDatabase extends GeneratedDatabase {
_$AppDatabase(QueryExecutor e) : super(e);
$AppDatabaseManager get managers => $AppDatabaseManager(this);
late final $VarietiesTable varieties = $VarietiesTable(this);
late final $VarietyVernacularNamesTable varietyVernacularNames =
$VarietyVernacularNamesTable(this);
late final $SpeciesTable species = $SpeciesTable(this);
late final $SpeciesCommonNamesTable speciesCommonNames =
$SpeciesCommonNamesTable(this);
late final $LotsTable lots = $LotsTable(this);
late final $GerminationTestsTable germinationTests = $GerminationTestsTable(
this,
);
late final $MovementsTable movements = $MovementsTable(this);
late final $PartiesTable parties = $PartiesTable(this);
late final $AttachmentsTable attachments = $AttachmentsTable(this);
late final $ExternalLinksTable externalLinks = $ExternalLinksTable(this);
@override
Iterable<TableInfo<Table, Object?>> get allTables =>
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
@override
List<DatabaseSchemaEntity> get allSchemaEntities => [
varieties,
varietyVernacularNames,
species,
speciesCommonNames,
lots,
germinationTests,
movements,
parties,
attachments,
externalLinks,
];
}
typedef $$VarietiesTableCreateCompanionBuilder =
VarietiesCompanion Function({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
required String label,
Value<String?> speciesId,
Value<String?> cultivarName,
Value<String?> category,
Value<String?> notes,
Value<int> rowid,
});
typedef $$VarietiesTableUpdateCompanionBuilder =
VarietiesCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> updatedAt,
Value<String> lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
Value<String> label,
Value<String?> speciesId,
Value<String?> cultivarName,
Value<String?> category,
Value<String?> notes,
Value<int> rowid,
});
class $$VarietiesTableFilterComposer
extends Composer<_$AppDatabase, $VarietiesTable> {
$$VarietiesTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get label => $composableBuilder(
column: $table.label,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get speciesId => $composableBuilder(
column: $table.speciesId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get cultivarName => $composableBuilder(
column: $table.cultivarName,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get category => $composableBuilder(
column: $table.category,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get notes => $composableBuilder(
column: $table.notes,
builder: (column) => ColumnFilters(column),
);
}
class $$VarietiesTableOrderingComposer
extends Composer<_$AppDatabase, $VarietiesTable> {
$$VarietiesTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get label => $composableBuilder(
column: $table.label,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get speciesId => $composableBuilder(
column: $table.speciesId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get cultivarName => $composableBuilder(
column: $table.cultivarName,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get category => $composableBuilder(
column: $table.category,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get notes => $composableBuilder(
column: $table.notes,
builder: (column) => ColumnOrderings(column),
);
}
class $$VarietiesTableAnnotationComposer
extends Composer<_$AppDatabase, $VarietiesTable> {
$$VarietiesTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<bool> get isDeleted =>
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumn<String> get label =>
$composableBuilder(column: $table.label, builder: (column) => column);
GeneratedColumn<String> get speciesId =>
$composableBuilder(column: $table.speciesId, builder: (column) => column);
GeneratedColumn<String> get cultivarName => $composableBuilder(
column: $table.cultivarName,
builder: (column) => column,
);
GeneratedColumn<String> get category =>
$composableBuilder(column: $table.category, builder: (column) => column);
GeneratedColumn<String> get notes =>
$composableBuilder(column: $table.notes, builder: (column) => column);
}
class $$VarietiesTableTableManager
extends
RootTableManager<
_$AppDatabase,
$VarietiesTable,
Variety,
$$VarietiesTableFilterComposer,
$$VarietiesTableOrderingComposer,
$$VarietiesTableAnnotationComposer,
$$VarietiesTableCreateCompanionBuilder,
$$VarietiesTableUpdateCompanionBuilder,
(Variety, BaseReferences<_$AppDatabase, $VarietiesTable, Variety>),
Variety,
PrefetchHooks Function()
> {
$$VarietiesTableTableManager(_$AppDatabase db, $VarietiesTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$VarietiesTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$VarietiesTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$VarietiesTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> updatedAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<String> label = const Value.absent(),
Value<String?> speciesId = const Value.absent(),
Value<String?> cultivarName = const Value.absent(),
Value<String?> category = const Value.absent(),
Value<String?> notes = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => VarietiesCompanion(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
label: label,
speciesId: speciesId,
cultivarName: cultivarName,
category: category,
notes: notes,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
required String label,
Value<String?> speciesId = const Value.absent(),
Value<String?> cultivarName = const Value.absent(),
Value<String?> category = const Value.absent(),
Value<String?> notes = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => VarietiesCompanion.insert(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
label: label,
speciesId: speciesId,
cultivarName: cultivarName,
category: category,
notes: notes,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$VarietiesTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$VarietiesTable,
Variety,
$$VarietiesTableFilterComposer,
$$VarietiesTableOrderingComposer,
$$VarietiesTableAnnotationComposer,
$$VarietiesTableCreateCompanionBuilder,
$$VarietiesTableUpdateCompanionBuilder,
(Variety, BaseReferences<_$AppDatabase, $VarietiesTable, Variety>),
Variety,
PrefetchHooks Function()
>;
typedef $$VarietyVernacularNamesTableCreateCompanionBuilder =
VarietyVernacularNamesCompanion Function({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
required String varietyId,
required String name,
Value<String?> language,
Value<String?> region,
Value<int> rowid,
});
typedef $$VarietyVernacularNamesTableUpdateCompanionBuilder =
VarietyVernacularNamesCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> updatedAt,
Value<String> lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
Value<String> varietyId,
Value<String> name,
Value<String?> language,
Value<String?> region,
Value<int> rowid,
});
class $$VarietyVernacularNamesTableFilterComposer
extends Composer<_$AppDatabase, $VarietyVernacularNamesTable> {
$$VarietyVernacularNamesTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get varietyId => $composableBuilder(
column: $table.varietyId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get name => $composableBuilder(
column: $table.name,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get language => $composableBuilder(
column: $table.language,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get region => $composableBuilder(
column: $table.region,
builder: (column) => ColumnFilters(column),
);
}
class $$VarietyVernacularNamesTableOrderingComposer
extends Composer<_$AppDatabase, $VarietyVernacularNamesTable> {
$$VarietyVernacularNamesTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get varietyId => $composableBuilder(
column: $table.varietyId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get name => $composableBuilder(
column: $table.name,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get language => $composableBuilder(
column: $table.language,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get region => $composableBuilder(
column: $table.region,
builder: (column) => ColumnOrderings(column),
);
}
class $$VarietyVernacularNamesTableAnnotationComposer
extends Composer<_$AppDatabase, $VarietyVernacularNamesTable> {
$$VarietyVernacularNamesTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<bool> get isDeleted =>
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumn<String> get varietyId =>
$composableBuilder(column: $table.varietyId, builder: (column) => column);
GeneratedColumn<String> get name =>
$composableBuilder(column: $table.name, builder: (column) => column);
GeneratedColumn<String> get language =>
$composableBuilder(column: $table.language, builder: (column) => column);
GeneratedColumn<String> get region =>
$composableBuilder(column: $table.region, builder: (column) => column);
}
class $$VarietyVernacularNamesTableTableManager
extends
RootTableManager<
_$AppDatabase,
$VarietyVernacularNamesTable,
VarietyVernacularName,
$$VarietyVernacularNamesTableFilterComposer,
$$VarietyVernacularNamesTableOrderingComposer,
$$VarietyVernacularNamesTableAnnotationComposer,
$$VarietyVernacularNamesTableCreateCompanionBuilder,
$$VarietyVernacularNamesTableUpdateCompanionBuilder,
(
VarietyVernacularName,
BaseReferences<
_$AppDatabase,
$VarietyVernacularNamesTable,
VarietyVernacularName
>,
),
VarietyVernacularName,
PrefetchHooks Function()
> {
$$VarietyVernacularNamesTableTableManager(
_$AppDatabase db,
$VarietyVernacularNamesTable table,
) : super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$VarietyVernacularNamesTableFilterComposer(
$db: db,
$table: table,
),
createOrderingComposer: () =>
$$VarietyVernacularNamesTableOrderingComposer(
$db: db,
$table: table,
),
createComputedFieldComposer: () =>
$$VarietyVernacularNamesTableAnnotationComposer(
$db: db,
$table: table,
),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> updatedAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<String> varietyId = const Value.absent(),
Value<String> name = const Value.absent(),
Value<String?> language = const Value.absent(),
Value<String?> region = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => VarietyVernacularNamesCompanion(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
varietyId: varietyId,
name: name,
language: language,
region: region,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
required String varietyId,
required String name,
Value<String?> language = const Value.absent(),
Value<String?> region = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => VarietyVernacularNamesCompanion.insert(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
varietyId: varietyId,
name: name,
language: language,
region: region,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$VarietyVernacularNamesTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$VarietyVernacularNamesTable,
VarietyVernacularName,
$$VarietyVernacularNamesTableFilterComposer,
$$VarietyVernacularNamesTableOrderingComposer,
$$VarietyVernacularNamesTableAnnotationComposer,
$$VarietyVernacularNamesTableCreateCompanionBuilder,
$$VarietyVernacularNamesTableUpdateCompanionBuilder,
(
VarietyVernacularName,
BaseReferences<
_$AppDatabase,
$VarietyVernacularNamesTable,
VarietyVernacularName
>,
),
VarietyVernacularName,
PrefetchHooks Function()
>;
typedef $$SpeciesTableCreateCompanionBuilder =
SpeciesCompanion Function({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
required String scientificName,
Value<String?> wikidataQid,
Value<int?> gbifKey,
Value<String?> family,
Value<bool> isBundled,
Value<int> rowid,
});
typedef $$SpeciesTableUpdateCompanionBuilder =
SpeciesCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> updatedAt,
Value<String> lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
Value<String> scientificName,
Value<String?> wikidataQid,
Value<int?> gbifKey,
Value<String?> family,
Value<bool> isBundled,
Value<int> rowid,
});
class $$SpeciesTableFilterComposer
extends Composer<_$AppDatabase, $SpeciesTable> {
$$SpeciesTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get scientificName => $composableBuilder(
column: $table.scientificName,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get wikidataQid => $composableBuilder(
column: $table.wikidataQid,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get gbifKey => $composableBuilder(
column: $table.gbifKey,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get family => $composableBuilder(
column: $table.family,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isBundled => $composableBuilder(
column: $table.isBundled,
builder: (column) => ColumnFilters(column),
);
}
class $$SpeciesTableOrderingComposer
extends Composer<_$AppDatabase, $SpeciesTable> {
$$SpeciesTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get scientificName => $composableBuilder(
column: $table.scientificName,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get wikidataQid => $composableBuilder(
column: $table.wikidataQid,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get gbifKey => $composableBuilder(
column: $table.gbifKey,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get family => $composableBuilder(
column: $table.family,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isBundled => $composableBuilder(
column: $table.isBundled,
builder: (column) => ColumnOrderings(column),
);
}
class $$SpeciesTableAnnotationComposer
extends Composer<_$AppDatabase, $SpeciesTable> {
$$SpeciesTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<bool> get isDeleted =>
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumn<String> get scientificName => $composableBuilder(
column: $table.scientificName,
builder: (column) => column,
);
GeneratedColumn<String> get wikidataQid => $composableBuilder(
column: $table.wikidataQid,
builder: (column) => column,
);
GeneratedColumn<int> get gbifKey =>
$composableBuilder(column: $table.gbifKey, builder: (column) => column);
GeneratedColumn<String> get family =>
$composableBuilder(column: $table.family, builder: (column) => column);
GeneratedColumn<bool> get isBundled =>
$composableBuilder(column: $table.isBundled, builder: (column) => column);
}
class $$SpeciesTableTableManager
extends
RootTableManager<
_$AppDatabase,
$SpeciesTable,
Specy,
$$SpeciesTableFilterComposer,
$$SpeciesTableOrderingComposer,
$$SpeciesTableAnnotationComposer,
$$SpeciesTableCreateCompanionBuilder,
$$SpeciesTableUpdateCompanionBuilder,
(Specy, BaseReferences<_$AppDatabase, $SpeciesTable, Specy>),
Specy,
PrefetchHooks Function()
> {
$$SpeciesTableTableManager(_$AppDatabase db, $SpeciesTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$SpeciesTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$SpeciesTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$SpeciesTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> updatedAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<String> scientificName = const Value.absent(),
Value<String?> wikidataQid = const Value.absent(),
Value<int?> gbifKey = const Value.absent(),
Value<String?> family = const Value.absent(),
Value<bool> isBundled = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => SpeciesCompanion(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
scientificName: scientificName,
wikidataQid: wikidataQid,
gbifKey: gbifKey,
family: family,
isBundled: isBundled,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
required String scientificName,
Value<String?> wikidataQid = const Value.absent(),
Value<int?> gbifKey = const Value.absent(),
Value<String?> family = const Value.absent(),
Value<bool> isBundled = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => SpeciesCompanion.insert(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
scientificName: scientificName,
wikidataQid: wikidataQid,
gbifKey: gbifKey,
family: family,
isBundled: isBundled,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$SpeciesTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$SpeciesTable,
Specy,
$$SpeciesTableFilterComposer,
$$SpeciesTableOrderingComposer,
$$SpeciesTableAnnotationComposer,
$$SpeciesTableCreateCompanionBuilder,
$$SpeciesTableUpdateCompanionBuilder,
(Specy, BaseReferences<_$AppDatabase, $SpeciesTable, Specy>),
Specy,
PrefetchHooks Function()
>;
typedef $$SpeciesCommonNamesTableCreateCompanionBuilder =
SpeciesCommonNamesCompanion Function({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
required String speciesId,
required String name,
Value<String?> language,
Value<int> rowid,
});
typedef $$SpeciesCommonNamesTableUpdateCompanionBuilder =
SpeciesCommonNamesCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> updatedAt,
Value<String> lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
Value<String> speciesId,
Value<String> name,
Value<String?> language,
Value<int> rowid,
});
class $$SpeciesCommonNamesTableFilterComposer
extends Composer<_$AppDatabase, $SpeciesCommonNamesTable> {
$$SpeciesCommonNamesTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get speciesId => $composableBuilder(
column: $table.speciesId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get name => $composableBuilder(
column: $table.name,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get language => $composableBuilder(
column: $table.language,
builder: (column) => ColumnFilters(column),
);
}
class $$SpeciesCommonNamesTableOrderingComposer
extends Composer<_$AppDatabase, $SpeciesCommonNamesTable> {
$$SpeciesCommonNamesTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get speciesId => $composableBuilder(
column: $table.speciesId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get name => $composableBuilder(
column: $table.name,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get language => $composableBuilder(
column: $table.language,
builder: (column) => ColumnOrderings(column),
);
}
class $$SpeciesCommonNamesTableAnnotationComposer
extends Composer<_$AppDatabase, $SpeciesCommonNamesTable> {
$$SpeciesCommonNamesTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<bool> get isDeleted =>
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumn<String> get speciesId =>
$composableBuilder(column: $table.speciesId, builder: (column) => column);
GeneratedColumn<String> get name =>
$composableBuilder(column: $table.name, builder: (column) => column);
GeneratedColumn<String> get language =>
$composableBuilder(column: $table.language, builder: (column) => column);
}
class $$SpeciesCommonNamesTableTableManager
extends
RootTableManager<
_$AppDatabase,
$SpeciesCommonNamesTable,
SpeciesCommonName,
$$SpeciesCommonNamesTableFilterComposer,
$$SpeciesCommonNamesTableOrderingComposer,
$$SpeciesCommonNamesTableAnnotationComposer,
$$SpeciesCommonNamesTableCreateCompanionBuilder,
$$SpeciesCommonNamesTableUpdateCompanionBuilder,
(
SpeciesCommonName,
BaseReferences<
_$AppDatabase,
$SpeciesCommonNamesTable,
SpeciesCommonName
>,
),
SpeciesCommonName,
PrefetchHooks Function()
> {
$$SpeciesCommonNamesTableTableManager(
_$AppDatabase db,
$SpeciesCommonNamesTable table,
) : super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$SpeciesCommonNamesTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$SpeciesCommonNamesTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$SpeciesCommonNamesTableAnnotationComposer(
$db: db,
$table: table,
),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> updatedAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<String> speciesId = const Value.absent(),
Value<String> name = const Value.absent(),
Value<String?> language = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => SpeciesCommonNamesCompanion(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
speciesId: speciesId,
name: name,
language: language,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
required String speciesId,
required String name,
Value<String?> language = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => SpeciesCommonNamesCompanion.insert(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
speciesId: speciesId,
name: name,
language: language,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$SpeciesCommonNamesTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$SpeciesCommonNamesTable,
SpeciesCommonName,
$$SpeciesCommonNamesTableFilterComposer,
$$SpeciesCommonNamesTableOrderingComposer,
$$SpeciesCommonNamesTableAnnotationComposer,
$$SpeciesCommonNamesTableCreateCompanionBuilder,
$$SpeciesCommonNamesTableUpdateCompanionBuilder,
(
SpeciesCommonName,
BaseReferences<
_$AppDatabase,
$SpeciesCommonNamesTable,
SpeciesCommonName
>,
),
SpeciesCommonName,
PrefetchHooks Function()
>;
typedef $$LotsTableCreateCompanionBuilder =
LotsCompanion Function({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
required String varietyId,
Value<int?> harvestYear,
Value<String?> quantityKind,
Value<double?> quantityPrecise,
Value<String?> quantityLabel,
Value<String?> storageLocation,
Value<OfferStatus> offerStatus,
Value<String?> seedbankId,
Value<int> rowid,
});
typedef $$LotsTableUpdateCompanionBuilder =
LotsCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> updatedAt,
Value<String> lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
Value<String> varietyId,
Value<int?> harvestYear,
Value<String?> quantityKind,
Value<double?> quantityPrecise,
Value<String?> quantityLabel,
Value<String?> storageLocation,
Value<OfferStatus> offerStatus,
Value<String?> seedbankId,
Value<int> rowid,
});
class $$LotsTableFilterComposer extends Composer<_$AppDatabase, $LotsTable> {
$$LotsTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get varietyId => $composableBuilder(
column: $table.varietyId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get harvestYear => $composableBuilder(
column: $table.harvestYear,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get quantityKind => $composableBuilder(
column: $table.quantityKind,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get quantityPrecise => $composableBuilder(
column: $table.quantityPrecise,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get quantityLabel => $composableBuilder(
column: $table.quantityLabel,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get storageLocation => $composableBuilder(
column: $table.storageLocation,
builder: (column) => ColumnFilters(column),
);
ColumnWithTypeConverterFilters<OfferStatus, OfferStatus, String>
get offerStatus => $composableBuilder(
column: $table.offerStatus,
builder: (column) => ColumnWithTypeConverterFilters(column),
);
ColumnFilters<String> get seedbankId => $composableBuilder(
column: $table.seedbankId,
builder: (column) => ColumnFilters(column),
);
}
class $$LotsTableOrderingComposer extends Composer<_$AppDatabase, $LotsTable> {
$$LotsTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get varietyId => $composableBuilder(
column: $table.varietyId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get harvestYear => $composableBuilder(
column: $table.harvestYear,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get quantityKind => $composableBuilder(
column: $table.quantityKind,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get quantityPrecise => $composableBuilder(
column: $table.quantityPrecise,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get quantityLabel => $composableBuilder(
column: $table.quantityLabel,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get storageLocation => $composableBuilder(
column: $table.storageLocation,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get offerStatus => $composableBuilder(
column: $table.offerStatus,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get seedbankId => $composableBuilder(
column: $table.seedbankId,
builder: (column) => ColumnOrderings(column),
);
}
class $$LotsTableAnnotationComposer
extends Composer<_$AppDatabase, $LotsTable> {
$$LotsTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<bool> get isDeleted =>
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumn<String> get varietyId =>
$composableBuilder(column: $table.varietyId, builder: (column) => column);
GeneratedColumn<int> get harvestYear => $composableBuilder(
column: $table.harvestYear,
builder: (column) => column,
);
GeneratedColumn<String> get quantityKind => $composableBuilder(
column: $table.quantityKind,
builder: (column) => column,
);
GeneratedColumn<double> get quantityPrecise => $composableBuilder(
column: $table.quantityPrecise,
builder: (column) => column,
);
GeneratedColumn<String> get quantityLabel => $composableBuilder(
column: $table.quantityLabel,
builder: (column) => column,
);
GeneratedColumn<String> get storageLocation => $composableBuilder(
column: $table.storageLocation,
builder: (column) => column,
);
GeneratedColumnWithTypeConverter<OfferStatus, String> get offerStatus =>
$composableBuilder(
column: $table.offerStatus,
builder: (column) => column,
);
GeneratedColumn<String> get seedbankId => $composableBuilder(
column: $table.seedbankId,
builder: (column) => column,
);
}
class $$LotsTableTableManager
extends
RootTableManager<
_$AppDatabase,
$LotsTable,
Lot,
$$LotsTableFilterComposer,
$$LotsTableOrderingComposer,
$$LotsTableAnnotationComposer,
$$LotsTableCreateCompanionBuilder,
$$LotsTableUpdateCompanionBuilder,
(Lot, BaseReferences<_$AppDatabase, $LotsTable, Lot>),
Lot,
PrefetchHooks Function()
> {
$$LotsTableTableManager(_$AppDatabase db, $LotsTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$LotsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$LotsTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$LotsTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> updatedAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<String> varietyId = const Value.absent(),
Value<int?> harvestYear = const Value.absent(),
Value<String?> quantityKind = const Value.absent(),
Value<double?> quantityPrecise = const Value.absent(),
Value<String?> quantityLabel = const Value.absent(),
Value<String?> storageLocation = const Value.absent(),
Value<OfferStatus> offerStatus = const Value.absent(),
Value<String?> seedbankId = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => LotsCompanion(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
varietyId: varietyId,
harvestYear: harvestYear,
quantityKind: quantityKind,
quantityPrecise: quantityPrecise,
quantityLabel: quantityLabel,
storageLocation: storageLocation,
offerStatus: offerStatus,
seedbankId: seedbankId,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
required String varietyId,
Value<int?> harvestYear = const Value.absent(),
Value<String?> quantityKind = const Value.absent(),
Value<double?> quantityPrecise = const Value.absent(),
Value<String?> quantityLabel = const Value.absent(),
Value<String?> storageLocation = const Value.absent(),
Value<OfferStatus> offerStatus = const Value.absent(),
Value<String?> seedbankId = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => LotsCompanion.insert(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
varietyId: varietyId,
harvestYear: harvestYear,
quantityKind: quantityKind,
quantityPrecise: quantityPrecise,
quantityLabel: quantityLabel,
storageLocation: storageLocation,
offerStatus: offerStatus,
seedbankId: seedbankId,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$LotsTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$LotsTable,
Lot,
$$LotsTableFilterComposer,
$$LotsTableOrderingComposer,
$$LotsTableAnnotationComposer,
$$LotsTableCreateCompanionBuilder,
$$LotsTableUpdateCompanionBuilder,
(Lot, BaseReferences<_$AppDatabase, $LotsTable, Lot>),
Lot,
PrefetchHooks Function()
>;
typedef $$GerminationTestsTableCreateCompanionBuilder =
GerminationTestsCompanion Function({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
required String lotId,
Value<int?> testedOn,
Value<int?> sampleSize,
Value<int?> germinatedCount,
Value<String?> notes,
Value<int> rowid,
});
typedef $$GerminationTestsTableUpdateCompanionBuilder =
GerminationTestsCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> updatedAt,
Value<String> lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
Value<String> lotId,
Value<int?> testedOn,
Value<int?> sampleSize,
Value<int?> germinatedCount,
Value<String?> notes,
Value<int> rowid,
});
class $$GerminationTestsTableFilterComposer
extends Composer<_$AppDatabase, $GerminationTestsTable> {
$$GerminationTestsTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lotId => $composableBuilder(
column: $table.lotId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get testedOn => $composableBuilder(
column: $table.testedOn,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get sampleSize => $composableBuilder(
column: $table.sampleSize,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get germinatedCount => $composableBuilder(
column: $table.germinatedCount,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get notes => $composableBuilder(
column: $table.notes,
builder: (column) => ColumnFilters(column),
);
}
class $$GerminationTestsTableOrderingComposer
extends Composer<_$AppDatabase, $GerminationTestsTable> {
$$GerminationTestsTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lotId => $composableBuilder(
column: $table.lotId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get testedOn => $composableBuilder(
column: $table.testedOn,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get sampleSize => $composableBuilder(
column: $table.sampleSize,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get germinatedCount => $composableBuilder(
column: $table.germinatedCount,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get notes => $composableBuilder(
column: $table.notes,
builder: (column) => ColumnOrderings(column),
);
}
class $$GerminationTestsTableAnnotationComposer
extends Composer<_$AppDatabase, $GerminationTestsTable> {
$$GerminationTestsTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<bool> get isDeleted =>
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumn<String> get lotId =>
$composableBuilder(column: $table.lotId, builder: (column) => column);
GeneratedColumn<int> get testedOn =>
$composableBuilder(column: $table.testedOn, builder: (column) => column);
GeneratedColumn<int> get sampleSize => $composableBuilder(
column: $table.sampleSize,
builder: (column) => column,
);
GeneratedColumn<int> get germinatedCount => $composableBuilder(
column: $table.germinatedCount,
builder: (column) => column,
);
GeneratedColumn<String> get notes =>
$composableBuilder(column: $table.notes, builder: (column) => column);
}
class $$GerminationTestsTableTableManager
extends
RootTableManager<
_$AppDatabase,
$GerminationTestsTable,
GerminationTest,
$$GerminationTestsTableFilterComposer,
$$GerminationTestsTableOrderingComposer,
$$GerminationTestsTableAnnotationComposer,
$$GerminationTestsTableCreateCompanionBuilder,
$$GerminationTestsTableUpdateCompanionBuilder,
(
GerminationTest,
BaseReferences<
_$AppDatabase,
$GerminationTestsTable,
GerminationTest
>,
),
GerminationTest,
PrefetchHooks Function()
> {
$$GerminationTestsTableTableManager(
_$AppDatabase db,
$GerminationTestsTable table,
) : super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$GerminationTestsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$GerminationTestsTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$GerminationTestsTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> updatedAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<String> lotId = const Value.absent(),
Value<int?> testedOn = const Value.absent(),
Value<int?> sampleSize = const Value.absent(),
Value<int?> germinatedCount = const Value.absent(),
Value<String?> notes = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => GerminationTestsCompanion(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
lotId: lotId,
testedOn: testedOn,
sampleSize: sampleSize,
germinatedCount: germinatedCount,
notes: notes,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
required String lotId,
Value<int?> testedOn = const Value.absent(),
Value<int?> sampleSize = const Value.absent(),
Value<int?> germinatedCount = const Value.absent(),
Value<String?> notes = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => GerminationTestsCompanion.insert(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
lotId: lotId,
testedOn: testedOn,
sampleSize: sampleSize,
germinatedCount: germinatedCount,
notes: notes,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$GerminationTestsTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$GerminationTestsTable,
GerminationTest,
$$GerminationTestsTableFilterComposer,
$$GerminationTestsTableOrderingComposer,
$$GerminationTestsTableAnnotationComposer,
$$GerminationTestsTableCreateCompanionBuilder,
$$GerminationTestsTableUpdateCompanionBuilder,
(
GerminationTest,
BaseReferences<_$AppDatabase, $GerminationTestsTable, GerminationTest>,
),
GerminationTest,
PrefetchHooks Function()
>;
typedef $$MovementsTableCreateCompanionBuilder =
MovementsCompanion Function({
required String id,
required int createdAt,
required String lastAuthor,
Value<int> schemaRowVersion,
required String lotId,
required MovementType type,
Value<int?> occurredOn,
Value<String?> counterpartyId,
Value<String?> quantityKind,
Value<double?> quantityPrecise,
Value<String?> quantityLabel,
Value<String?> parentMovementId,
Value<String?> plantareId,
Value<String?> notes,
Value<int> rowid,
});
typedef $$MovementsTableUpdateCompanionBuilder =
MovementsCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> lastAuthor,
Value<int> schemaRowVersion,
Value<String> lotId,
Value<MovementType> type,
Value<int?> occurredOn,
Value<String?> counterpartyId,
Value<String?> quantityKind,
Value<double?> quantityPrecise,
Value<String?> quantityLabel,
Value<String?> parentMovementId,
Value<String?> plantareId,
Value<String?> notes,
Value<int> rowid,
});
class $$MovementsTableFilterComposer
extends Composer<_$AppDatabase, $MovementsTable> {
$$MovementsTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lotId => $composableBuilder(
column: $table.lotId,
builder: (column) => ColumnFilters(column),
);
ColumnWithTypeConverterFilters<MovementType, MovementType, String> get type =>
$composableBuilder(
column: $table.type,
builder: (column) => ColumnWithTypeConverterFilters(column),
);
ColumnFilters<int> get occurredOn => $composableBuilder(
column: $table.occurredOn,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get counterpartyId => $composableBuilder(
column: $table.counterpartyId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get quantityKind => $composableBuilder(
column: $table.quantityKind,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<double> get quantityPrecise => $composableBuilder(
column: $table.quantityPrecise,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get quantityLabel => $composableBuilder(
column: $table.quantityLabel,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get parentMovementId => $composableBuilder(
column: $table.parentMovementId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get plantareId => $composableBuilder(
column: $table.plantareId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get notes => $composableBuilder(
column: $table.notes,
builder: (column) => ColumnFilters(column),
);
}
class $$MovementsTableOrderingComposer
extends Composer<_$AppDatabase, $MovementsTable> {
$$MovementsTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lotId => $composableBuilder(
column: $table.lotId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get type => $composableBuilder(
column: $table.type,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get occurredOn => $composableBuilder(
column: $table.occurredOn,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get counterpartyId => $composableBuilder(
column: $table.counterpartyId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get quantityKind => $composableBuilder(
column: $table.quantityKind,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<double> get quantityPrecise => $composableBuilder(
column: $table.quantityPrecise,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get quantityLabel => $composableBuilder(
column: $table.quantityLabel,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get parentMovementId => $composableBuilder(
column: $table.parentMovementId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get plantareId => $composableBuilder(
column: $table.plantareId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get notes => $composableBuilder(
column: $table.notes,
builder: (column) => ColumnOrderings(column),
);
}
class $$MovementsTableAnnotationComposer
extends Composer<_$AppDatabase, $MovementsTable> {
$$MovementsTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumn<String> get lotId =>
$composableBuilder(column: $table.lotId, builder: (column) => column);
GeneratedColumnWithTypeConverter<MovementType, String> get type =>
$composableBuilder(column: $table.type, builder: (column) => column);
GeneratedColumn<int> get occurredOn => $composableBuilder(
column: $table.occurredOn,
builder: (column) => column,
);
GeneratedColumn<String> get counterpartyId => $composableBuilder(
column: $table.counterpartyId,
builder: (column) => column,
);
GeneratedColumn<String> get quantityKind => $composableBuilder(
column: $table.quantityKind,
builder: (column) => column,
);
GeneratedColumn<double> get quantityPrecise => $composableBuilder(
column: $table.quantityPrecise,
builder: (column) => column,
);
GeneratedColumn<String> get quantityLabel => $composableBuilder(
column: $table.quantityLabel,
builder: (column) => column,
);
GeneratedColumn<String> get parentMovementId => $composableBuilder(
column: $table.parentMovementId,
builder: (column) => column,
);
GeneratedColumn<String> get plantareId => $composableBuilder(
column: $table.plantareId,
builder: (column) => column,
);
GeneratedColumn<String> get notes =>
$composableBuilder(column: $table.notes, builder: (column) => column);
}
class $$MovementsTableTableManager
extends
RootTableManager<
_$AppDatabase,
$MovementsTable,
Movement,
$$MovementsTableFilterComposer,
$$MovementsTableOrderingComposer,
$$MovementsTableAnnotationComposer,
$$MovementsTableCreateCompanionBuilder,
$$MovementsTableUpdateCompanionBuilder,
(Movement, BaseReferences<_$AppDatabase, $MovementsTable, Movement>),
Movement,
PrefetchHooks Function()
> {
$$MovementsTableTableManager(_$AppDatabase db, $MovementsTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$MovementsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$MovementsTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$MovementsTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<String> lotId = const Value.absent(),
Value<MovementType> type = const Value.absent(),
Value<int?> occurredOn = const Value.absent(),
Value<String?> counterpartyId = const Value.absent(),
Value<String?> quantityKind = const Value.absent(),
Value<double?> quantityPrecise = const Value.absent(),
Value<String?> quantityLabel = const Value.absent(),
Value<String?> parentMovementId = const Value.absent(),
Value<String?> plantareId = const Value.absent(),
Value<String?> notes = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => MovementsCompanion(
id: id,
createdAt: createdAt,
lastAuthor: lastAuthor,
schemaRowVersion: schemaRowVersion,
lotId: lotId,
type: type,
occurredOn: occurredOn,
counterpartyId: counterpartyId,
quantityKind: quantityKind,
quantityPrecise: quantityPrecise,
quantityLabel: quantityLabel,
parentMovementId: parentMovementId,
plantareId: plantareId,
notes: notes,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String lastAuthor,
Value<int> schemaRowVersion = const Value.absent(),
required String lotId,
required MovementType type,
Value<int?> occurredOn = const Value.absent(),
Value<String?> counterpartyId = const Value.absent(),
Value<String?> quantityKind = const Value.absent(),
Value<double?> quantityPrecise = const Value.absent(),
Value<String?> quantityLabel = const Value.absent(),
Value<String?> parentMovementId = const Value.absent(),
Value<String?> plantareId = const Value.absent(),
Value<String?> notes = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => MovementsCompanion.insert(
id: id,
createdAt: createdAt,
lastAuthor: lastAuthor,
schemaRowVersion: schemaRowVersion,
lotId: lotId,
type: type,
occurredOn: occurredOn,
counterpartyId: counterpartyId,
quantityKind: quantityKind,
quantityPrecise: quantityPrecise,
quantityLabel: quantityLabel,
parentMovementId: parentMovementId,
plantareId: plantareId,
notes: notes,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$MovementsTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$MovementsTable,
Movement,
$$MovementsTableFilterComposer,
$$MovementsTableOrderingComposer,
$$MovementsTableAnnotationComposer,
$$MovementsTableCreateCompanionBuilder,
$$MovementsTableUpdateCompanionBuilder,
(Movement, BaseReferences<_$AppDatabase, $MovementsTable, Movement>),
Movement,
PrefetchHooks Function()
>;
typedef $$PartiesTableCreateCompanionBuilder =
PartiesCompanion Function({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
required String displayName,
Value<String?> publicKey,
Value<PartyKind> kind,
Value<String?> note,
Value<int> rowid,
});
typedef $$PartiesTableUpdateCompanionBuilder =
PartiesCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> updatedAt,
Value<String> lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
Value<String> displayName,
Value<String?> publicKey,
Value<PartyKind> kind,
Value<String?> note,
Value<int> rowid,
});
class $$PartiesTableFilterComposer
extends Composer<_$AppDatabase, $PartiesTable> {
$$PartiesTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get displayName => $composableBuilder(
column: $table.displayName,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get publicKey => $composableBuilder(
column: $table.publicKey,
builder: (column) => ColumnFilters(column),
);
ColumnWithTypeConverterFilters<PartyKind, PartyKind, String> get kind =>
$composableBuilder(
column: $table.kind,
builder: (column) => ColumnWithTypeConverterFilters(column),
);
ColumnFilters<String> get note => $composableBuilder(
column: $table.note,
builder: (column) => ColumnFilters(column),
);
}
class $$PartiesTableOrderingComposer
extends Composer<_$AppDatabase, $PartiesTable> {
$$PartiesTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get displayName => $composableBuilder(
column: $table.displayName,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get publicKey => $composableBuilder(
column: $table.publicKey,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get kind => $composableBuilder(
column: $table.kind,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get note => $composableBuilder(
column: $table.note,
builder: (column) => ColumnOrderings(column),
);
}
class $$PartiesTableAnnotationComposer
extends Composer<_$AppDatabase, $PartiesTable> {
$$PartiesTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<bool> get isDeleted =>
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumn<String> get displayName => $composableBuilder(
column: $table.displayName,
builder: (column) => column,
);
GeneratedColumn<String> get publicKey =>
$composableBuilder(column: $table.publicKey, builder: (column) => column);
GeneratedColumnWithTypeConverter<PartyKind, String> get kind =>
$composableBuilder(column: $table.kind, builder: (column) => column);
GeneratedColumn<String> get note =>
$composableBuilder(column: $table.note, builder: (column) => column);
}
class $$PartiesTableTableManager
extends
RootTableManager<
_$AppDatabase,
$PartiesTable,
Party,
$$PartiesTableFilterComposer,
$$PartiesTableOrderingComposer,
$$PartiesTableAnnotationComposer,
$$PartiesTableCreateCompanionBuilder,
$$PartiesTableUpdateCompanionBuilder,
(Party, BaseReferences<_$AppDatabase, $PartiesTable, Party>),
Party,
PrefetchHooks Function()
> {
$$PartiesTableTableManager(_$AppDatabase db, $PartiesTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$PartiesTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$PartiesTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$PartiesTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> updatedAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<String> displayName = const Value.absent(),
Value<String?> publicKey = const Value.absent(),
Value<PartyKind> kind = const Value.absent(),
Value<String?> note = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => PartiesCompanion(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
displayName: displayName,
publicKey: publicKey,
kind: kind,
note: note,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
required String displayName,
Value<String?> publicKey = const Value.absent(),
Value<PartyKind> kind = const Value.absent(),
Value<String?> note = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => PartiesCompanion.insert(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
displayName: displayName,
publicKey: publicKey,
kind: kind,
note: note,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$PartiesTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$PartiesTable,
Party,
$$PartiesTableFilterComposer,
$$PartiesTableOrderingComposer,
$$PartiesTableAnnotationComposer,
$$PartiesTableCreateCompanionBuilder,
$$PartiesTableUpdateCompanionBuilder,
(Party, BaseReferences<_$AppDatabase, $PartiesTable, Party>),
Party,
PrefetchHooks Function()
>;
typedef $$AttachmentsTableCreateCompanionBuilder =
AttachmentsCompanion Function({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
required ParentType parentType,
required String parentId,
required AttachmentKind kind,
Value<String?> uri,
Value<Uint8List?> bytes,
Value<String?> mimeType,
Value<int> rowid,
});
typedef $$AttachmentsTableUpdateCompanionBuilder =
AttachmentsCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> updatedAt,
Value<String> lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
Value<ParentType> parentType,
Value<String> parentId,
Value<AttachmentKind> kind,
Value<String?> uri,
Value<Uint8List?> bytes,
Value<String?> mimeType,
Value<int> rowid,
});
class $$AttachmentsTableFilterComposer
extends Composer<_$AppDatabase, $AttachmentsTable> {
$$AttachmentsTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnWithTypeConverterFilters<ParentType, ParentType, String>
get parentType => $composableBuilder(
column: $table.parentType,
builder: (column) => ColumnWithTypeConverterFilters(column),
);
ColumnFilters<String> get parentId => $composableBuilder(
column: $table.parentId,
builder: (column) => ColumnFilters(column),
);
ColumnWithTypeConverterFilters<AttachmentKind, AttachmentKind, String>
get kind => $composableBuilder(
column: $table.kind,
builder: (column) => ColumnWithTypeConverterFilters(column),
);
ColumnFilters<String> get uri => $composableBuilder(
column: $table.uri,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<Uint8List> get bytes => $composableBuilder(
column: $table.bytes,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get mimeType => $composableBuilder(
column: $table.mimeType,
builder: (column) => ColumnFilters(column),
);
}
class $$AttachmentsTableOrderingComposer
extends Composer<_$AppDatabase, $AttachmentsTable> {
$$AttachmentsTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get parentType => $composableBuilder(
column: $table.parentType,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get parentId => $composableBuilder(
column: $table.parentId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get kind => $composableBuilder(
column: $table.kind,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get uri => $composableBuilder(
column: $table.uri,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<Uint8List> get bytes => $composableBuilder(
column: $table.bytes,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get mimeType => $composableBuilder(
column: $table.mimeType,
builder: (column) => ColumnOrderings(column),
);
}
class $$AttachmentsTableAnnotationComposer
extends Composer<_$AppDatabase, $AttachmentsTable> {
$$AttachmentsTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<bool> get isDeleted =>
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumnWithTypeConverter<ParentType, String> get parentType =>
$composableBuilder(
column: $table.parentType,
builder: (column) => column,
);
GeneratedColumn<String> get parentId =>
$composableBuilder(column: $table.parentId, builder: (column) => column);
GeneratedColumnWithTypeConverter<AttachmentKind, String> get kind =>
$composableBuilder(column: $table.kind, builder: (column) => column);
GeneratedColumn<String> get uri =>
$composableBuilder(column: $table.uri, builder: (column) => column);
GeneratedColumn<Uint8List> get bytes =>
$composableBuilder(column: $table.bytes, builder: (column) => column);
GeneratedColumn<String> get mimeType =>
$composableBuilder(column: $table.mimeType, builder: (column) => column);
}
class $$AttachmentsTableTableManager
extends
RootTableManager<
_$AppDatabase,
$AttachmentsTable,
Attachment,
$$AttachmentsTableFilterComposer,
$$AttachmentsTableOrderingComposer,
$$AttachmentsTableAnnotationComposer,
$$AttachmentsTableCreateCompanionBuilder,
$$AttachmentsTableUpdateCompanionBuilder,
(
Attachment,
BaseReferences<_$AppDatabase, $AttachmentsTable, Attachment>,
),
Attachment,
PrefetchHooks Function()
> {
$$AttachmentsTableTableManager(_$AppDatabase db, $AttachmentsTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$AttachmentsTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$AttachmentsTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$AttachmentsTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> updatedAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<ParentType> parentType = const Value.absent(),
Value<String> parentId = const Value.absent(),
Value<AttachmentKind> kind = const Value.absent(),
Value<String?> uri = const Value.absent(),
Value<Uint8List?> bytes = const Value.absent(),
Value<String?> mimeType = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => AttachmentsCompanion(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
parentType: parentType,
parentId: parentId,
kind: kind,
uri: uri,
bytes: bytes,
mimeType: mimeType,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
required ParentType parentType,
required String parentId,
required AttachmentKind kind,
Value<String?> uri = const Value.absent(),
Value<Uint8List?> bytes = const Value.absent(),
Value<String?> mimeType = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => AttachmentsCompanion.insert(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
parentType: parentType,
parentId: parentId,
kind: kind,
uri: uri,
bytes: bytes,
mimeType: mimeType,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$AttachmentsTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$AttachmentsTable,
Attachment,
$$AttachmentsTableFilterComposer,
$$AttachmentsTableOrderingComposer,
$$AttachmentsTableAnnotationComposer,
$$AttachmentsTableCreateCompanionBuilder,
$$AttachmentsTableUpdateCompanionBuilder,
(
Attachment,
BaseReferences<_$AppDatabase, $AttachmentsTable, Attachment>,
),
Attachment,
PrefetchHooks Function()
>;
typedef $$ExternalLinksTableCreateCompanionBuilder =
ExternalLinksCompanion Function({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
required ParentType parentType,
required String parentId,
required String url,
Value<String?> title,
Value<int> rowid,
});
typedef $$ExternalLinksTableUpdateCompanionBuilder =
ExternalLinksCompanion Function({
Value<String> id,
Value<int> createdAt,
Value<String> updatedAt,
Value<String> lastAuthor,
Value<bool> isDeleted,
Value<int> schemaRowVersion,
Value<ParentType> parentType,
Value<String> parentId,
Value<String> url,
Value<String?> title,
Value<int> rowid,
});
class $$ExternalLinksTableFilterComposer
extends Composer<_$AppDatabase, $ExternalLinksTable> {
$$ExternalLinksTableFilterComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnFilters<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnFilters(column),
);
ColumnWithTypeConverterFilters<ParentType, ParentType, String>
get parentType => $composableBuilder(
column: $table.parentType,
builder: (column) => ColumnWithTypeConverterFilters(column),
);
ColumnFilters<String> get parentId => $composableBuilder(
column: $table.parentId,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get url => $composableBuilder(
column: $table.url,
builder: (column) => ColumnFilters(column),
);
ColumnFilters<String> get title => $composableBuilder(
column: $table.title,
builder: (column) => ColumnFilters(column),
);
}
class $$ExternalLinksTableOrderingComposer
extends Composer<_$AppDatabase, $ExternalLinksTable> {
$$ExternalLinksTableOrderingComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
ColumnOrderings<String> get id => $composableBuilder(
column: $table.id,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get createdAt => $composableBuilder(
column: $table.createdAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get updatedAt => $composableBuilder(
column: $table.updatedAt,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<bool> get isDeleted => $composableBuilder(
column: $table.isDeleted,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get parentType => $composableBuilder(
column: $table.parentType,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get parentId => $composableBuilder(
column: $table.parentId,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get url => $composableBuilder(
column: $table.url,
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<String> get title => $composableBuilder(
column: $table.title,
builder: (column) => ColumnOrderings(column),
);
}
class $$ExternalLinksTableAnnotationComposer
extends Composer<_$AppDatabase, $ExternalLinksTable> {
$$ExternalLinksTableAnnotationComposer({
required super.$db,
required super.$table,
super.joinBuilder,
super.$addJoinBuilderToRootComposer,
super.$removeJoinBuilderFromRootComposer,
});
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get createdAt =>
$composableBuilder(column: $table.createdAt, builder: (column) => column);
GeneratedColumn<String> get updatedAt =>
$composableBuilder(column: $table.updatedAt, builder: (column) => column);
GeneratedColumn<String> get lastAuthor => $composableBuilder(
column: $table.lastAuthor,
builder: (column) => column,
);
GeneratedColumn<bool> get isDeleted =>
$composableBuilder(column: $table.isDeleted, builder: (column) => column);
GeneratedColumn<int> get schemaRowVersion => $composableBuilder(
column: $table.schemaRowVersion,
builder: (column) => column,
);
GeneratedColumnWithTypeConverter<ParentType, String> get parentType =>
$composableBuilder(
column: $table.parentType,
builder: (column) => column,
);
GeneratedColumn<String> get parentId =>
$composableBuilder(column: $table.parentId, builder: (column) => column);
GeneratedColumn<String> get url =>
$composableBuilder(column: $table.url, builder: (column) => column);
GeneratedColumn<String> get title =>
$composableBuilder(column: $table.title, builder: (column) => column);
}
class $$ExternalLinksTableTableManager
extends
RootTableManager<
_$AppDatabase,
$ExternalLinksTable,
ExternalLink,
$$ExternalLinksTableFilterComposer,
$$ExternalLinksTableOrderingComposer,
$$ExternalLinksTableAnnotationComposer,
$$ExternalLinksTableCreateCompanionBuilder,
$$ExternalLinksTableUpdateCompanionBuilder,
(
ExternalLink,
BaseReferences<_$AppDatabase, $ExternalLinksTable, ExternalLink>,
),
ExternalLink,
PrefetchHooks Function()
> {
$$ExternalLinksTableTableManager(_$AppDatabase db, $ExternalLinksTable table)
: super(
TableManagerState(
db: db,
table: table,
createFilteringComposer: () =>
$$ExternalLinksTableFilterComposer($db: db, $table: table),
createOrderingComposer: () =>
$$ExternalLinksTableOrderingComposer($db: db, $table: table),
createComputedFieldComposer: () =>
$$ExternalLinksTableAnnotationComposer($db: db, $table: table),
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> createdAt = const Value.absent(),
Value<String> updatedAt = const Value.absent(),
Value<String> lastAuthor = const Value.absent(),
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
Value<ParentType> parentType = const Value.absent(),
Value<String> parentId = const Value.absent(),
Value<String> url = const Value.absent(),
Value<String?> title = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => ExternalLinksCompanion(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
parentType: parentType,
parentId: parentId,
url: url,
title: title,
rowid: rowid,
),
createCompanionCallback:
({
required String id,
required int createdAt,
required String updatedAt,
required String lastAuthor,
Value<bool> isDeleted = const Value.absent(),
Value<int> schemaRowVersion = const Value.absent(),
required ParentType parentType,
required String parentId,
required String url,
Value<String?> title = const Value.absent(),
Value<int> rowid = const Value.absent(),
}) => ExternalLinksCompanion.insert(
id: id,
createdAt: createdAt,
updatedAt: updatedAt,
lastAuthor: lastAuthor,
isDeleted: isDeleted,
schemaRowVersion: schemaRowVersion,
parentType: parentType,
parentId: parentId,
url: url,
title: title,
rowid: rowid,
),
withReferenceMapper: (p0) => p0
.map((e) => (e.readTable(table), BaseReferences(db, table, e)))
.toList(),
prefetchHooksCallback: null,
),
);
}
typedef $$ExternalLinksTableProcessedTableManager =
ProcessedTableManager<
_$AppDatabase,
$ExternalLinksTable,
ExternalLink,
$$ExternalLinksTableFilterComposer,
$$ExternalLinksTableOrderingComposer,
$$ExternalLinksTableAnnotationComposer,
$$ExternalLinksTableCreateCompanionBuilder,
$$ExternalLinksTableUpdateCompanionBuilder,
(
ExternalLink,
BaseReferences<_$AppDatabase, $ExternalLinksTable, ExternalLink>,
),
ExternalLink,
PrefetchHooks Function()
>;
class $AppDatabaseManager {
final _$AppDatabase _db;
$AppDatabaseManager(this._db);
$$VarietiesTableTableManager get varieties =>
$$VarietiesTableTableManager(_db, _db.varieties);
$$VarietyVernacularNamesTableTableManager get varietyVernacularNames =>
$$VarietyVernacularNamesTableTableManager(
_db,
_db.varietyVernacularNames,
);
$$SpeciesTableTableManager get species =>
$$SpeciesTableTableManager(_db, _db.species);
$$SpeciesCommonNamesTableTableManager get speciesCommonNames =>
$$SpeciesCommonNamesTableTableManager(_db, _db.speciesCommonNames);
$$LotsTableTableManager get lots => $$LotsTableTableManager(_db, _db.lots);
$$GerminationTestsTableTableManager get germinationTests =>
$$GerminationTestsTableTableManager(_db, _db.germinationTests);
$$MovementsTableTableManager get movements =>
$$MovementsTableTableManager(_db, _db.movements);
$$PartiesTableTableManager get parties =>
$$PartiesTableTableManager(_db, _db.parties);
$$AttachmentsTableTableManager get attachments =>
$$AttachmentsTableTableManager(_db, _db.attachments);
$$ExternalLinksTableTableManager get externalLinks =>
$$ExternalLinksTableTableManager(_db, _db.externalLinks);
}