How does this work business-wise? How does it make money?
Edit: Will Julia be supported in the future? This is not good... https://repl.it/@asemic/ConsiderateBelatedAccounting
For filtering/search queries, is the idea to use the prefix system to group related items together, and then run matches using that?
Yep, that's the idea. If you had a user with ID 1, one scheme to get all her info could be storing attributes in keys such as:
user:1:name
user:1:email
user:1:city
Then a prefix search for "user:1:" would get you the relevant keys for that user.But you could also go another way and drop a JSON-encoded object in a single key and work with it inside your app, since that might be the fastest way to get something off the ground!
https://www.alexdebrie.com/posts/dynamodb-single-table/
The post author actually wrote an entire book on data modeling with a single key/value table.
Turns out I had to sign in to repl.it for the sidebar icon to appear and the code to work.
The documentation (and that error message) might need to reflect this? And/or should databases be available to all users (i.e., those who aren't signed in as well)?
---
Another issue: when going to https://repl.it/repls/HandyNiceBug (providential URL...) ;-) even when signed in, running the code shows the same `REPLIT_DB_URL does not exist` error. If you click the database sidebar icon and any of the 'Insert ->' buttons, then the env seems to update and the code runs successfully.
---
Hopefully useful nitpick: after clicking the 'Insert ->' button once in the db sidebar UI (in the url above), all of the 'Insert ->' buttons stop working.
Aaaand, if I try manually copying any of the code snippets to insert one myself, what's copied into the clipboard is not-the-best. Instead of copying `db["key"] = "value"` for instance, it copies it but with many extra new lines and some bits missing. Might be useful to have a copy-to-clipboard icon? Or do some DOM trickery to allow selection/copy&paste?
Cheers :-)
Keeping each database outside of the filesystem also gives us the flexibility to let people access the same database across multiple repls in the future.
I have lots of love for SQLite; early prototypes of Database were backed by it!
I've been figuring out how to run backups recently and grabbing a copy of the file isn't enough - you need to be sure there are no transactions going on, so you need to use the SQLite backup API or run VACUUM INTO a separate copy, which then doubles the amount of disk space you need.