Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eatonphil/pgkv
pgkv: A key-value API for learning Postgres C
https://github.com/eatonphil/pgkv
Last synced: about 1 month ago
JSON representation
pgkv: A key-value API for learning Postgres C
- Host: GitHub
- URL: https://github.com/eatonphil/pgkv
- Owner: eatonphil
- License: mit
- Created: 2024-07-10T22:10:07.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-25T21:56:05.000Z (4 months ago)
- Last Synced: 2024-07-26T00:09:58.967Z (4 months ago)
- Language: C
- Homepage:
- Size: 14.6 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# pgkv: A key-value API for learning Postgres C
```console
$ make
$ make install
$ psql postgres --echo-all -f test.sql
DROP EXTENSION pgkv;
DROP EXTENSION
CREATE EXTENSION pgkv;
CREATE EXTENSION
SELECT pgkv.set('name.1', 'Tara');
set
-----(1 row)
SELECT pgkv.set('id.1', '10238');
set
-----(1 row)
SELECT pgkv.set('name.2', 'Minho');
set
-----(1 row)
SELECT pgkv.set('id.2', '299');
set
-----(1 row)
SELECT pgkv.list('name.');
list
---------------------------------
[name.1 = Tara, name.2 = Minho]
(1 row)SELECT pgkv.list('id.');
list
----------------------------
[id.1 = 10238, id.2 = 299]
(1 row)SELECT pgkv.list();
list
-----------------------------------------------------------
[name.1 = Tara, id.1 = 10238, name.2 = Minho, id.2 = 299]
(1 row)SELECT pgkv.list('name.1');
list
-----------------
[name.1 = Tara]
(1 row)SELECT pgkv.get('name.1');
get
------
Tara
(1 row)SELECT pgkv.del('id.1');
del
-----(1 row)
SELECT pgkv.del('name.1');
del
-----(1 row)
SELECT pgkv.list('name.');
list
------------------
[name.2 = Minho]
(1 row)SELECT pgkv.list('id.');
list
--------------
[id.2 = 299]
(1 row)
```