Drift generator file formatting issue #2686
-
First of all, I would like to thank you for the wonderful package that you provided. It helps us to implement complex relational data structures for our systems. I would like to bring your attention to one of the issues I'm facing right now.
Since it's a warning, I continue to run the code. Then I received the following:
What I have noticed is the comma separator is missing after each join statement. For the moment I'm manually adding missing commas to the generated file. Would like to know any fixes or where to look to debug the code to fix and make a PR.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm happy to hear that, thanks!
It looks like you can apply a workaround by calling .from(stockInRequests).join([
innerJoin(
products,
products.id.equalsExp(stockInRequests.productId),
),
]).join([
innerJoin(
divisions,
divisions.id.equalsExp(stockInRequests.divisionId),
),
]).join
...
A contribution would be great! The mistake appears to be the way drift reads Dart code for writing it later. We apply some transformations so that we're able to manage imports later. This transformation drops some commas though. We'd probably have to override drift/drift_dev/lib/src/analysis/results/dart.dart Lines 480 to 494 in 2582109 |
Beta Was this translation helpful? Give feedback.
I'm happy to hear that, thanks!
It looks like you can apply a workaround by calling
join
multiple times and never putting more than one item in the list:A contribution w…