Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ targets:
- '$package$'
- 'lib/$lib$'
- 'lib/account/models.dart'
- 'lib/database/**'
- 'lib/admin/models.dart'
- 'lib/dartdoc/models.dart'
- 'lib/frontend/handlers/pubapi.dart'
Expand Down
1 change: 1 addition & 0 deletions app/lib/admin/tools/delete_all_staging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Future<String> executeDeleteAllStaging(List<String> args) async {
dbService.query<ModeratedPackage>(): 500,
dbService.query<NeatTaskStatus>(): 500,
dbService.query<Secret>(): 500,
// ignore: deprecated_member_use_from_same_package
dbService.query<PackageState>(): 100,
};

Expand Down
32 changes: 32 additions & 0 deletions app/lib/database/model.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:convert' show json;

import 'package:gcloud/service_scope.dart' as ss;
import 'package:json_annotation/json_annotation.dart';
import 'package:meta/meta.dart';
import 'package:pub_dev/shared/exceptions.dart';
import 'package:pub_dev/task/models.dart'
show AbortedTokenInfo, PackageVersionStateInfo;
import 'package:typed_sql/typed_sql.dart';

export 'package:typed_sql/typed_sql.dart' hide AuthenticationException;

part 'model.g.dart';
part 'model.task.dart';

/// Sets the active [database].
void registerDatabase(Database<PrimaryDatabase> value) =>
ss.register(#_database, value);

/// The active [Database<PrimaryDatabase>].
Database<PrimaryDatabase> get database =>
ss.lookup(#_database) as Database<PrimaryDatabase>;

abstract final class PrimaryDatabase extends Schema {
Table<Task> get tasks;

Table<TaskDependency> get taskDependencies;
}
Loading
Loading