// GENERATED CODE, DO NOT EDIT BY HAND. //@dart=2.12 import 'package:drift/drift.dart'; class UsersData extends DataClass implements Insertable { final int id; final String name; UsersData({required this.id, required this.name}); factory UsersData.fromData(Map data, {String? prefix}) { final effectivePrefix = prefix ?? ''; return UsersData( id: const IntType() .mapFromDatabaseResponse(data['${effectivePrefix}id'])!, name: const StringType() .mapFromDatabaseResponse(data['${effectivePrefix}name'])!, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['name'] = Variable(name); return map; } UsersCompanion toCompanion(bool nullToAbsent) { return UsersCompanion( id: Value(id), name: Value(name), ); } factory UsersData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return UsersData( id: serializer.fromJson(json['id']), name: serializer.fromJson(json['name']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'name': serializer.toJson(name), }; } UsersData copyWith({int? id, String? name}) => UsersData( id: id ?? this.id, name: name ?? this.name, ); @override String toString() { return (StringBuffer('UsersData(') ..write('id: $id, ') ..write('name: $name') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, name); @override bool operator ==(Object other) => identical(this, other) || (other is UsersData && other.id == this.id && other.name == this.name); } class UsersCompanion extends UpdateCompanion { final Value id; final Value name; const UsersCompanion({ this.id = const Value.absent(), this.name = const Value.absent(), }); UsersCompanion.insert({ this.id = const Value.absent(), required String name, }) : name = Value(name); static Insertable custom({ Expression? id, Expression? name, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (name != null) 'name': name, }); } UsersCompanion copyWith({Value? id, Value? name}) { return UsersCompanion( id: id ?? this.id, name: name ?? this.name, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (name.present) { map['name'] = Variable(name.value); } return map; } @override String toString() { return (StringBuffer('UsersCompanion(') ..write('id: $id, ') ..write('name: $name') ..write(')')) .toString(); } } class Users extends Table with TableInfo { final GeneratedDatabase _db; final String? _alias; Users(this._db, [this._alias]); late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, typeName: 'INTEGER', requiredDuringInsert: false, defaultConstraints: 'PRIMARY KEY AUTOINCREMENT'); late final GeneratedColumn name = GeneratedColumn( 'name', aliasedName, false, typeName: 'TEXT', requiredDuringInsert: true); @override List get $columns => [id, name]; @override String get aliasedName => _alias ?? 'users'; @override String get actualTableName => 'users'; @override Set get $primaryKey => {id}; @override UsersData map(Map data, {String? tablePrefix}) { return UsersData.fromData(data, prefix: tablePrefix != null ? '$tablePrefix.' : null); } @override Users createAlias(String alias) { return Users(_db, alias); } @override bool get dontWriteConstraints => false; } class GroupsData extends DataClass implements Insertable { final int id; final String title; final bool? deleted; final int owner; GroupsData( {required this.id, required this.title, this.deleted, required this.owner}); factory GroupsData.fromData(Map data, {String? prefix}) { final effectivePrefix = prefix ?? ''; return GroupsData( id: const IntType() .mapFromDatabaseResponse(data['${effectivePrefix}id'])!, title: const StringType() .mapFromDatabaseResponse(data['${effectivePrefix}title'])!, deleted: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}deleted']), owner: const IntType() .mapFromDatabaseResponse(data['${effectivePrefix}owner'])!, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); map['title'] = Variable(title); if (!nullToAbsent || deleted != null) { map['deleted'] = Variable(deleted); } map['owner'] = Variable(owner); return map; } GroupsCompanion toCompanion(bool nullToAbsent) { return GroupsCompanion( id: Value(id), title: Value(title), deleted: deleted == null && nullToAbsent ? const Value.absent() : Value(deleted), owner: Value(owner), ); } factory GroupsData.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return GroupsData( id: serializer.fromJson(json['id']), title: serializer.fromJson(json['title']), deleted: serializer.fromJson(json['deleted']), owner: serializer.fromJson(json['owner']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), 'title': serializer.toJson(title), 'deleted': serializer.toJson(deleted), 'owner': serializer.toJson(owner), }; } GroupsData copyWith({int? id, String? title, bool? deleted, int? owner}) => GroupsData( id: id ?? this.id, title: title ?? this.title, deleted: deleted ?? this.deleted, owner: owner ?? this.owner, ); @override String toString() { return (StringBuffer('GroupsData(') ..write('id: $id, ') ..write('title: $title, ') ..write('deleted: $deleted, ') ..write('owner: $owner') ..write(')')) .toString(); } @override int get hashCode => Object.hash(id, title, deleted, owner); @override bool operator ==(Object other) => identical(this, other) || (other is GroupsData && other.id == this.id && other.title == this.title && other.deleted == this.deleted && other.owner == this.owner); } class GroupsCompanion extends UpdateCompanion { final Value id; final Value title; final Value deleted; final Value owner; const GroupsCompanion({ this.id = const Value.absent(), this.title = const Value.absent(), this.deleted = const Value.absent(), this.owner = const Value.absent(), }); GroupsCompanion.insert({ this.id = const Value.absent(), required String title, this.deleted = const Value.absent(), required int owner, }) : title = Value(title), owner = Value(owner); static Insertable custom({ Expression? id, Expression? title, Expression? deleted, Expression? owner, }) { return RawValuesInsertable({ if (id != null) 'id': id, if (title != null) 'title': title, if (deleted != null) 'deleted': deleted, if (owner != null) 'owner': owner, }); } GroupsCompanion copyWith( {Value? id, Value? title, Value? deleted, Value? owner}) { return GroupsCompanion( id: id ?? this.id, title: title ?? this.title, deleted: deleted ?? this.deleted, owner: owner ?? this.owner, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (id.present) { map['id'] = Variable(id.value); } if (title.present) { map['title'] = Variable(title.value); } if (deleted.present) { map['deleted'] = Variable(deleted.value); } if (owner.present) { map['owner'] = Variable(owner.value); } return map; } @override String toString() { return (StringBuffer('GroupsCompanion(') ..write('id: $id, ') ..write('title: $title, ') ..write('deleted: $deleted, ') ..write('owner: $owner') ..write(')')) .toString(); } } class Groups extends Table with TableInfo { final GeneratedDatabase _db; final String? _alias; Groups(this._db, [this._alias]); late final GeneratedColumn id = GeneratedColumn( 'id', aliasedName, false, typeName: 'INTEGER', requiredDuringInsert: false, $customConstraints: 'NOT NULL'); late final GeneratedColumn title = GeneratedColumn( 'title', aliasedName, false, typeName: 'TEXT', requiredDuringInsert: true, $customConstraints: 'NOT NULL'); late final GeneratedColumn deleted = GeneratedColumn( 'deleted', aliasedName, true, typeName: 'INTEGER', requiredDuringInsert: false, $customConstraints: 'DEFAULT FALSE', defaultValue: const CustomExpression('FALSE')); late final GeneratedColumn owner = GeneratedColumn( 'owner', aliasedName, false, typeName: 'INTEGER', requiredDuringInsert: true, $customConstraints: 'NOT NULL REFERENCES users (id)'); @override List get $columns => [id, title, deleted, owner]; @override String get aliasedName => _alias ?? 'groups'; @override String get actualTableName => 'groups'; @override Set get $primaryKey => {id}; @override GroupsData map(Map data, {String? tablePrefix}) { return GroupsData.fromData(data, prefix: tablePrefix != null ? '$tablePrefix.' : null); } @override Groups createAlias(String alias) { return Groups(_db, alias); } @override List get customConstraints => const ['PRIMARY KEY (id)']; @override bool get dontWriteConstraints => true; } class DatabaseAtV3 extends GeneratedDatabase { DatabaseAtV3(QueryExecutor e) : super(SqlTypeSystem.defaultInstance, e); DatabaseAtV3.connect(DatabaseConnection c) : super.connect(c); late final Users users = Users(this); late final Groups groups = Groups(this); @override Iterable get allTables => allSchemaEntities.whereType(); @override List get allSchemaEntities => [users, groups]; @override int get schemaVersion => 3; }