-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add docker image usage example
- Loading branch information
Showing
1 changed file
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,27 @@ | |
|
||
Embed an SQLite database in your PostgreSQL table. AKA multitenancy has been solved. | ||
|
||
## Usage | ||
|
||
Run a PostgreSQL database that has `ppglite-fusion` already installed. | ||
|
||
```bash | ||
docker run --network=host frectonz/pglite-fusion | ||
``` | ||
|
||
Connect to the PostgreSQL database using `psql`. | ||
|
||
```bash | ||
psql postgresql://postgres@localhost:5432/ | ||
``` | ||
|
||
Here's some demo usage example. | ||
|
||
```sql | ||
-- Load PG extension | ||
CREATE EXTENSION pglite_fusion; | ||
|
||
-- Create table wit an SQLite column | ||
-- Create a table with an SQLite column | ||
CREATE TABLE people ( | ||
name TEXT NOT NULL, | ||
database SQLITE DEFAULT execute_sqlite( | ||
|
@@ -26,7 +42,15 @@ SET database = execute_sqlite( | |
) | ||
WHERE name = 'frectonz'; | ||
|
||
-- Fetch frectonz's info form db | ||
-- Create a todo for "frectonz" | ||
UPDATE people | ||
SET database = execute_sqlite( | ||
database, | ||
'INSERT INTO todos VALUES (''buy milk'')' | ||
) | ||
WHERE name = 'frectonz'; | ||
|
||
-- Fetch frectonz's info | ||
SELECT | ||
name, | ||
( | ||
|
@@ -42,7 +66,7 @@ WHERE | |
name = 'frectonz'; | ||
``` | ||
|
||
## Run it | ||
## Build it from source | ||
|
||
```bash | ||
git clone [email protected]:frectonz/pglite-fusion.git | ||
|