Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Comments on Can I package a database other than SQLite with a Flutter app?

Post

Can I package a database other than SQLite with a Flutter app?

+2
−0

Flutter supports packaging a SQLite instance with a Flutter app using the Sqflite plugin. I do not like the speed of SQLite or the fact that it does not enforce column datatypes and want to use something like PostgreSQL or MySQL with my desktop app. Is there a way to do this in Flutter that doesn't require having users install the database separately before installing the application?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Why not SQLite? (8 comments)
Why not SQLite?
matthewsnyder‭ wrote over 1 year ago

Embedding Postgres/MySQL is a bad idea, they're huge and designed specifically not to be embedded. There are other embedded databases besides SQLite, but you should state exactly what your issue is with SQLite.

tarhalda‭ wrote over 1 year ago

SQLite doesn't enforce column datatypes. The code has to enforce the datatypes, which is error-prone.

Alexei‭ wrote over 1 year ago

Not used yet, but Sugar ORM might help when interacting with the SQLLite by automatically creating tables and query generation.

matthewsnyder‭ wrote over 1 year ago

tarhalda‭ Is enforcing types the only problem, or are there others?

tarhalda‭ wrote over 1 year ago

matthewsnyder‭ that's the main issue for my current application. I've also had issues with reading and writing simultaneously causing the database to lock instead of queuing the read.

matthewsnyder‭ wrote over 1 year ago · edited over 1 year ago

Hmm. Well, I would solve the concurrency issue by something like a semaphore (I assume you have multiple threads here). SQLite also supports write-ahead logging to deal with concurrent writes (I haven't used WAL though).

The typing I would solve by handling types in my app. If you are using an ORM that should take care of types.

I get that you've made up your mind that you want to look for something else though :)

cafce25‭ wrote over 1 year ago

If the lacking type rigidity is your main grip you might be interested in strict tables supported since sqlite 3.37.0 which enforce their column's type on any insert.

tarhalda‭ wrote over 1 year ago

@cafce25 that would solve my problem, thank you!

Skipping 1 deleted comment.