sqld
StorX
sqld | StorX | |
---|---|---|
9 | 5 | |
917 | 14 | |
- | - | |
9.6 | 10.0 | |
7 months ago | about 2 years ago | |
Rust | PHP | |
MIT License | GNU Affero General Public License v3.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sqld
-
LiteFS Cloud: Distributed SQLite with Managed Backups
There's https://github.com/libsql/sqld , but sqlite's concurrency model doesn't always work well with long-lived transactions (and just the network hop can be slower than a local transaction), especially if you want to write.
-
Get started with libSQL, a next-gen fork of SQLite
For instructions on how to build sqld from source, see the docs.
- Help me sell sqlite to my boss
-
Litestream is awesome for backing up sqlite databases
I also discovered https://github.com/libsql/sqld/ which provides similar functionality ("Bottomless replication"), and exposes the database over the network via the Postgres protocol. I haven't played with this yet, but it would be neat to try running some apps that require Postgres with this.
-
Early impressions of Turso, the edge database from ChiselStrike
There are some language-specific clients suited for data transaction with a Turso database, such as @libsql/client for TypeScript, libsql-client for Python, and libsql-client for Rust(currently works with Cloudflare workers), but for simplicity, we’re going to use curl scripts. We’ll interact with the database by sending HTTP POST requests containing the JSON-encoded SQL queries that we’d otherwise run on the SQL shell as already demonstrated. By supporting database interaction via the HTTP protocol, Turso guarantees easy access from all types of applications, especially edge functions.
-
SQLite-based databases on the Postgres protocol? Yes we can
- And you can embed it in your application and it will really talk to a "SQLite" database over the network: https://github.com/libsql/sqld (not a lot on consistency, I wonder how multiple writers are handled?)
- In 3 months, libsql released WASM functions, S3 WAL and network database sqld
- Sqld – a server mode for libSQL (SQLite fork) using the PostgreSQL wire protocol
- Sqld is a server mode for libSQL
StorX
-
PHP in 2024
Apparently it is still common practice to have such "if bla is set, when do blub" everywhere in ones code? No functions with decorators or a similar or alternative concept? I would think there should be some kind of easy to use mechanism in place, that tends to avoid forgetting these ifs.
There are ... 60 lines of global logic, that is not encapsulated in any function or so?
Some of the functions are quite long. But I think mostly because they render out HTML.
At line 107 with the procedure printHeader starting, what I call PHP nightmare starts:
Switching back and forth between PHP, HTML and HTML with integrated JS (!!!) and CSS. All of course without syntax highlighting, but that is a minor issue. The major issue is treating HTML and JS and CSS as mere strings, instead of structured data, and the very bad readability of having procedures suddenly "end" and spit out some wild HTML, then suddenly continuing again, because some server side logic/decision is required at some place in that stream of unstructured data, whether some part is to be included or not, then the stream continues and then at some point one needs to actually check, that one did not forget to truly end the procedure. This has some of the worst readability. Maybe C code with bit magic is worse.
One can find this kind of approach in many, if not most, Wordpress plugins. What's more is, that this is also terrible for writing tests. The procedures do not return a value to check against. All is a side effect. Perhaps there is some PHP library that manipulates the PHP system, so that one can at least do string comparisons on the side effects. Like mocking, basically. But still terrible for testing.
For a comparison of how it should be done instead, check any templating engine, that at least separates template files from PHP code. Better, checkout SXML libraries, that treat HTML as structured data, a tree that can be traversed and pattern matched against, without pulling out arcane string manipulations or regular expressions. And then consider how one could write tests based on such structured data.
If this "HTML is a string, even on the server side before sending it" kind of approach is how a language treats HTML, then the language is not suitable to be directly used for HTML templating, without any additional library. This alone has caused uncountable security issues in so many projects.
I realize, that this is probably kind of a "one off script" and may not reflect other kinds of PHP code.
I did all of those things myself, years ago. And when I already had moved away from such an approach, I had to maintain a project, that was written this way. It had no tests of course. No fun. It has not that much to do with you personally being a good dev or not. I think it has to do with the ecosystem encouraging you to do these things. Outputting HTML like that should be declared illegal and should be impossible.
https://github.com/aaviator42/StorX/blob/main/StorX.php in comparison looks much better. It seems it does not output things directly. Everything seems wrapped nicely into methods. One obvious footgun seems to be another global state thing, that I really hope is not a thing in PHP itself:
const THROW_EXCEPTIONS = TRUE;
-
Why you should probably be using SQLite
I'm a huge fan of SQLite! My org's apps use it heavily, often via this simple key-value interface built on sqlite: https://github.com/aaviator42/StorX
Handles tens of thousands of requests a day very smoothly! :)
-
Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
My org's apps heavily use this simple key-value interface built on sqlite: https://github.com/aaviator42/StorX
There's also a bunch of other purpose-built tiny utilities on that GitHub account.
-
SQLite-based databases on the Postgres protocol? Yes we can
I wrote a small PHP library that gives you a key-value storage interface to SQlite files: https://github.com/aaviator42/StorX
I've been dogfooding for a while by using it in my side projects.
And there's a basic API too, to use it over a network: https://github.com/aaviator42/StorX-API
-
Soul – A SQLite RESTful Server
This is probably ready to be used in production by others, but I wrote a library that gives you a key-value storage interface to SQlite files: https://github.com/aaviator42/StorX
And there's an API too, to use it over a network: https://github.com/aaviator42/StorX-API
What are some alternatives?
litefs-js - JavaScript utilities for working with LiteFS on Fly.io
StorX-API - A REST API for StorX
mycelite - Mycelite is a SQLite extension that allows you to synchronize changes from one instance of SQLite to another.
libsql - libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
configinator
stream-sqlite - Python function to extract rows from a SQLite file while iterating over its bytes
zfs-autosnap - Minimal viable ZFS autosnapshot tool
donutdb - Store and query a sqlite db directly backed by DynamoDB.
roapi - Create full-fledged APIs for slowly moving datasets without writing a single line of code.
popcorn-time - Example application using libSQL's sqld + express + Vue.js
bottomless