-
Notifications
You must be signed in to change notification settings - Fork 161
Initial migration of task backend to typed_sql #8784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some files like database/model.dart
is missing. Also needs merge fixes.
Otherwise I like really the new sql-way :)
686703f
to
06bd9c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still looking good.
List<String> _updatedDependencies( | ||
List<String>? dependencies, | ||
List<String>? discoveredDependencies, { | ||
List<String> _newDependencies( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's document what this method does.
Aside: This may be in another step, but with SQL, we should probably check if we can get away with simpler behavior, e.g. not reading and processing everything, or, maybe updating the dependent package's timestamp through a query.
name: 'task', | ||
as: 'dependencies', | ||
) | ||
abstract final class TaskDependency extends Row { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this need @PrimaryKey[]
?
Also, I'm wondering if the order of the keys should start with the dependency, maybe it could have performance benefits if/when later we update the dependent package's flag/timestamp with a query.
|
||
@immutable | ||
@JsonSerializable() | ||
final class TaskState implements CustomDataType<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: How far would it be to implement CustomDataType<Json>
and using JSONB
under the hood? I think it is so wasteful to keep this data as string instead of JSONB
...
await db.tasks | ||
.where((task) => task.runtimeVersion < gcBeforeRuntimeVersion.asExpr) | ||
.delete() | ||
.execute(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: wouldn't the delete()
call before the where()
make more sense? It kind of make sense for the select()
projection to be just before e.g. stream()
lie a few lines below, but for delete()
, I could imagine it above it. This feels like the delete()
and execute()
calls should be a single method call, but maybe that fades more with further familiarity of the library use.
@@ -37,6 +37,11 @@ class _EnvConfig { | |||
/// Youtube API key to use (skips Datastore secret). | |||
late final youtubeApiKey = Platform.environment['YOUTUBE_API_KEY']; | |||
|
|||
/// True, if the process is running in a CI environment. | |||
late final isContinuesIntegration = !['false', '0', ''].contains( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: rename to isContinuousIntegration
or isCI
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
though, I think we should rather have the explicit true
(or maybe 1
) check instead of negating the negative.
No description provided.