-
Notifications
You must be signed in to change notification settings - Fork 5
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
Silexcorp dart3 #10
base: main
Are you sure you want to change the base?
Silexcorp dart3 #10
Conversation
@@ -1,23 +1,23 @@ | |||
name: streamqflite | |||
description: reactive stream wrapper around sqflite inspired by sqlbrite | |||
version: 1.0.0 | |||
version: 2.2.3 |
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.
Curious why 2.2.3? I guess to match sqflite
? I don't think we need to actually track that closely with versions so 2.0.0
would be fine.
Database? db; | ||
StreamDatabase? streamDb; |
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 you can declare these as late to avoid the unwrapping latter https://dart.dev/null-safety/understanding-null-safety#late-variables
@@ -243,9 +243,10 @@ class QueryStream extends Stream<LazyQuery> { | |||
|
|||
Stream<List<T>> mapToList<T>(T mapper(Map<String, dynamic> row)) { | |||
return _source.asyncMap((query) => query()).map((rows) { | |||
var result = List<T>(rows.length); | |||
//var result = List<T>(rows.length); | |||
List<T> result = []; |
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.
This removes the admittedly minor optimization of sizing the list so it doesn't have to reallocate, just curious if there's a way to do that now, maybe by defining a capacity?
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.
After searching might be able to use https://api.dart.dev/stable/2.16.2/dart-core/List/List.generate.html?
@@ -243,9 +243,10 @@ class QueryStream extends Stream<LazyQuery> { | |||
|
|||
Stream<List<T>> mapToList<T>(T mapper(Map<String, dynamic> row)) { | |||
return _source.asyncMap((query) => query()).map((rows) { | |||
var result = List<T>(rows.length); | |||
//var result = List<T>(rows.length); |
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.
Would be good to remove commented out code
Thank you :D I'll keep it in mind. |
No description provided.