Skip to content
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

Plugin: database #6676

Closed
joeblew99 opened this issue Nov 3, 2016 · 14 comments
Closed

Plugin: database #6676

joeblew99 opened this issue Nov 3, 2016 · 14 comments
Labels
c: new feature Nothing broken; request for a new capability package flutter/packages repository. See also p: labels. would be a good package Separate Flutter package should be made for this

Comments

@joeblew99
Copy link

this was discussed on https://gitter.im/flutter/flutter

There is a need for a Database for flutter apps, that is easy to get going with.

two options were discussed:
https://github.com/adamlofts/leveldb_dart might be interesting
it looks like it has a binary component to it as well, which might require some integration work

https://github.com/pylaligand/dart-sqlite looks similar


i also found https://github.com/tekartik/sembast.dart
It works with flutter now apparently.
i have not tried it yet.

@abarth abarth added this to the 3: Make conferences happy milestone Nov 3, 2016
@abarth abarth added affects: services c: new feature Nothing broken; request for a new capability labels Nov 3, 2016
@sethladd
Copy link
Contributor

sethladd commented Nov 3, 2016

What kind of database are you thinking? What kind of data did you need to store?

Both platforms expose sqlite. There's also 3rd party services like Realm.

@sureshg
Copy link

sureshg commented Nov 3, 2016

@sethladd how do we access it in flutter, using platform services (https://flutter.io/platform-services/) ? It would be nice if we have one abstracted dart API to store data, without writing the boilerplate for each host platform.

@sethladd
Copy link
Contributor

sethladd commented Nov 3, 2016

It would be nice if we have one abstracted dart API to store data

True, but unfortunately there isn't One True Way to store and retrieve data. Some people want SQL. Some people want key/value. Some apps want to optimize for size on disk. Some apps want to sync to the cloud. Etc, etc.

That said, I think it's fairly common to want to store structured, queriable data locally in some sort of SQL-esque database. Both platforms have APIs for these. Perhaps that's a good place to start.

In the meantime, yes, you can use the "platform services" API.

@joeblew99
Copy link
Author

@sethladd

i agree that there is no one true DB :) a KV store like the one i linked is a good start.

https://flutter.io/platform-services/ allow calling out to Android java Land and IOS objc 7 Swift land, which is not what i am proposing because its not cross platform.

We can do better.
What i am proposing is a pure Dart DB (https://github.com/tekartik/sembast.dart)
Its a basic kv style store.

I currently run this on mobiles, desktop and server. Its very useful to be able to run the same queries everywhere ..

@sureshg
Copy link

sureshg commented Nov 14, 2016

@sethladd I agree. But the thing is, for any non-trivial mobile app requires some database to store it's data/config and providing a data store out of the box would be great instead of writing the host platform interfacing code in both java and obj c/swift (if you are targeting cross platform).

@joeblew99
Copy link
Author

I will add to this. I was using golang to build mobile database using bolt DB.
It works, but the amount of plumbing you need to put in so that your GUI code can talk to the DB code is insane.
I dont want to do it that way anymore :)

@mit-mit mit-mit changed the title feature request - a database for flutter apps Plugin: database Feb 2, 2017
@Hixie Hixie added the plugin label May 23, 2017
@mit-mit
Copy link
Member

mit-mit commented Jun 29, 2017

Someone in the community just published a SQLite plugin:
https://pub.dartlang.org/packages/sqflite

@ZakTaccardi
Copy link

A reactive SQLite DB in the vein of Room is an absolute necessity.

@LouisCAD
Copy link

I agree with @ZakTaccardi, a Room-like API for Flutter that work on all target platforms would be really great

@Hixie
Copy link
Contributor

Hixie commented Dec 20, 2017

This is not something that's on our priority list for the next few months. It seems like a project that would be ripe for making as a separate plugin, though.

@Hixie Hixie modified the milestones: 3: Current Milestone, 6: Future Future Dec 20, 2017
@Hixie Hixie added the would be a good package Separate Flutter package should be made for this label Dec 20, 2017
@crossle
Copy link

crossle commented Feb 24, 2018

Agree, Android Room SQLite API great

@jaumard
Copy link
Contributor

jaumard commented Jul 6, 2018

A first ORM support can be found here https://github.com/Jaguar-dart/jaguar_orm, an sqflite adapter is ongoing and for now a first basic support is already working.
An example of what is currently working is here https://github.com/jaguar-orm/sqflite

@zoechi zoechi added would be a good package Separate Flutter package should be made for this and removed would be a good package Separate Flutter package should be made for this p: self service labels Jan 9, 2019
@timsneath
Copy link
Contributor

At this time, there are a number of plugins that support various types of persistent store, including SQLite, Firebase Realtime Database and MongoDB.

Closing this issue for now, since the parent use case is increasingly well provided for; feel free to open other issues for more specific needs that remain unaddressed with the current Google and community offerings.

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 29, 2021
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: new feature Nothing broken; request for a new capability package flutter/packages repository. See also p: labels. would be a good package Separate Flutter package should be made for this
Projects
None yet
Development

No branches or pull requests