Comments (9)
sql.js
is looking more promising indeed, I managed to get a minimal prototype with persistence working. What still needs to be done:
- Transactions
- Batched statements
- Returning the insert id for
INSERT
statements - The new "before open but after migrations" callback from version 1.5
- Tests!
from drift.
Started some work for this on the web
branch, I hope to make a working prototype out of that next week.
from drift.
I've already taken a quick look at AlaSQL and considered adding web support for moor using that library in the past. The effort would depend entirely on how different AlaSQL is to sqlite, I didn't take an in-depth look yet. I'll do that soon.
from drift.
Great news, let me know when it's ready. I will have a look at it with my team then! :)
from drift.
Sorry for the delay on this. Unfortunately, AlaSQL has some issues which makes it really hard to work with. It doesn't support some sqlite functions, doesn't persist table changes (so default values will be gone when reloading the page) and doesn't really support migrations. I've used some hacky workarounds to counter some of these problems, but the whole thing is still very unreliable. It also doesn't seem to be very well maintained, having many important issues open for a long time.
I'll try sql.js next. It requires webassembly, but that should be available on most modern browsers anyway. The big advantage is that it will behave exactly the same as sqlite, although persisting changes is a bit tricky at the moment.
from drift.
So this landed in develop
and will be a part of moor 1.6! I've written some documentation on how to use moor for the web here.
If you want to try this out now, you'll need to use a dependency override pointing to the moor/
folder on the develop
branch in this repo. Also, don't consider the format in which the database is stored finalized yet, it will be changed (which breaks existing databases) before version 1.6 is released publicly.
Here is the source code for a simple todo app built using moor and flutter for web. It's deployed here. You can see the sql statements sent in the console. Web support is not optimized for performance yet, so it can take a while to show/add entries.
from drift.
Really cool 💪🏼! Thanks for the effort 🙏🏻!
I will try it out and give you feedback asap.
from drift.
FYI, the breaking encoding change is now on develop
- the way databases are stored is final now, but you need to localStorage.clear()
pages where you've already used moor for web.
Also, web support now lives on beta
and I'll hopefully release it on pub later this week. Closing this issue now as web support is done. If you run into any issues, please let me know by opening another issue, thanks!
from drift.
If you're using (or plan on using) drift with web apps, I'm currently looking for feedback to help get this feature stable. So if you have the time, sharing feedback about the ideas in #2382 would help stabilize this feature!
from drift.
Related Issues (20)
- The non-abstract class is missing implementation HOT 2
- JSONB (JSON) and UUID column support? [.drift] [Postgres] HOT 1
- Problems with Postgres column types / compatibility in Table definitions HOT 1
- Automatically synchronize data to the server HOT 8
- Unable to handle multiple same db data class retrival at the same time. HOT 2
- Nested queries got laggy on UI HOT 7
- BLOB Primary key fails using equals expression HOT 3
- Flutter windows desktop app freezes when bulk operation in database taking place HOT 4
- Documentation issue: Custom row classes HOT 4
- Unknown issue on Safari, with Potential route of Discovery HOT 4
- ON CONFLICT UPDATE not working on drift files HOT 5
- Could not able to use `WITH` & `AS` keyword together in `.drfit` file HOT 2
- "Operation was cancelled" error HOT 6
- Wrong link in the docs which lead to 404 HOT 1
- Add coverage ignore for generated files HOT 2
- My lord, serious lock problem when try accessing data while updating it. HOT 6
- How do I SUM column in join? HOT 2
- When using PgTypes cannot generate a dialect for Sqllite. HOT 2
- SQLite file is modified with select statements HOT 5
- Correct declination for tables ending on "y" / "ies" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drift.