https://github.com/worksofliam/rpgnosql
Ability to use JSON store table in RPGLE
https://github.com/worksofliam/rpgnosql
Last synced: 3 months ago
JSON representation
Ability to use JSON store table in RPGLE
- Host: GitHub
- URL: https://github.com/worksofliam/rpgnosql
- Owner: worksofliam
- Created: 2020-07-26T16:03:52.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-27T11:56:11.000Z (almost 6 years ago)
- Last Synced: 2025-03-15T01:14:14.836Z (over 1 year ago)
- Language: TSQL
- Size: 250 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## RPGNoSQL
This is an idea for a service program to fetch data from a table which contains a BSON (blob) column. This means not only can your data scale veritcally, it also means it can grow horizontally.
Inspiration from the post [JSON data in SQL Server](https://docs.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server?view=sql-server-ver15).
#### Installation
1. Clone
2. `cd rpgnosql`
3. Create the `RPGNOSQL` library
4. `gmake`
#### Example
See the `examples` directory for an example.
```
Dcl-S index Int(3);
Dcl-S CurrentName Char(30);
Dcl-S CurrentBalance Packed(9:2);
NoSQL_Table('barry.docs');
If (NoSQL_Open());
index = 0;
Dow (NoSQL_Next() and index < 10);
CurrentName = NoSQL_AsString('$.name');
CurrentBalance = NoSQL_AsNumber('$.balance');
Dsply (%TrimR(CurrentName) + ' - ' + %Char(CurrentBalance));
index += 1;
Enddo;
NoSQL_Close();
Endif;
```