| Crates.io | sq |
| lib.rs | sq |
| version | 0.4.4 |
| created_at | 2024-12-27 05:48:10.044007+00 |
| updated_at | 2025-07-11 02:00:41.612884+00 |
| description | A minimal client-server for phext hosting |
| homepage | https://phext.io/ |
| repository | |
| max_upload_size | |
| id | 1496214 |
| size | 2,860,130 |
SQ: The Simple Query Tool
SQ is a modern database, written from the ground-up to take advantage of Phext: 11-dimensional plain hypertext. Like normal SQL databases, it has multiple pronunciations: "esque", "S-Q", "Seek", "Super Quine", and "Self Query".
you can either clone this repo and run cargo build, or just install the latest stable build: cargo install sq. You may have also arrived here from Choose Your Own Adventure...
SQ is designed to keep abstractions to a minimum. You can interact with phexts via shared memory (daemon "esque" mode) or a TCP socket ("seek" mode) with a simple REST API.
Daemon Mode: If you supply a filename parameter to sq, it will launch in daemon mode - communicating with local system processes via shared memoryListening Mode: If you supply a port number to sq, it will launch in web server mode - listening on the TCP socket requestedSQ is a complete ground-up rewrite of database concepts. It probably doesn't have features you expect from a database. What it does offer is simplicity. SQ is designed to mirror computer architecture in 2025, not 1970. Databases are stored in phext files using variable-length scrolls. Essentially, everything in a phext database is a string.
SQ leverages Rust and libphext-rs to provide the core data store. All database primitives in SQ are built in terms of phext. For more information about the phext encoding format, refer to https://phext.io.
In daemon mode, SQ uses shared memory to ensure that data transfers to/from the database engine are done as quickly as possible. The shared memory segments are managed by files stored in the .sq directory where you invoked SQ from. It is expected that you will run the client and the server from the same directory.
In listening mode, SQ reads and writes phexts via REST.
SQ offers a simple CRUD-style REST API. The API allows you to interact with multiple phexts from CURL or your web browser. Saving is automatic - if a command changes the content of a phext, it will be saved to disk immediately. Note that if you change the loaded phext without issuing a load command, SQ will automatically reload from disk first.
phext.phext into the current contextcoordinate in phext.phextcoordinate in phext.phextcoordinate in phext.phextcoordinate in phext.phextThe name SQ was inspired by this tweet: https://x.com/HSVSphere/status/1849817225038840016
SQ was bundled into CYOA on 6/12/2025.