Drift files vs Dart code #1513
Replies: 2 comments 1 reply
-
Some very minor features may only be available in Drift files or only available in Dart code. In general, they can be used interchangeably though (Dart code can write queries for Drift-defined tables, and vice-versa). My recommendation would be to start using the format you're more comfortable with:
But I think that personal preferences should weight more than that. If you like writing SQL, Drift files are the tool for you! If prefer writing Dart, you can do that too! Both options are first-class APIs and are designed to complement each other. |
Beta Was this translation helpful? Give feedback.
-
From my experience you later have to write some SQL for table migrations anyways so I found it easier to directly start with Drift-files. |
Beta Was this translation helpful? Give feedback.
-
What are the preferable way to create a database structure and queries in Drift?
Will Drift files and Dart code be always interchangeable and can be used both separately and together?
Just curious what technic is better to use in a new project?
Beta Was this translation helpful? Give feedback.
All reactions