@ronin/compiler 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +35 -0
- package/dist/index.d.ts +4706 -0
- package/dist/index.js +1093 -0
- package/package.json +34 -0
package/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# RONIN Compiler
|
2
|
+
|
3
|
+
This package compiles RONIN queries to SQL statements.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
```typescript
|
8
|
+
import { compileQueryInput } from '@ronin/compiler';
|
9
|
+
|
10
|
+
const query = {
|
11
|
+
get: {
|
12
|
+
accounts: null,
|
13
|
+
},
|
14
|
+
};
|
15
|
+
|
16
|
+
const schemas = [
|
17
|
+
{
|
18
|
+
pluralSlug: 'accounts',
|
19
|
+
slug: 'account',
|
20
|
+
},
|
21
|
+
];
|
22
|
+
|
23
|
+
const { writeStatements, readStatement } = compileQueryInput(query, schemas);
|
24
|
+
|
25
|
+
console.log(readStatement);
|
26
|
+
// SELECT * FROM "accounts" ORDER BY "ronin.createdAt" DESC LIMIT 101
|
27
|
+
```
|
28
|
+
|
29
|
+
## Testing
|
30
|
+
|
31
|
+
Use the following command to run the test suite:
|
32
|
+
|
33
|
+
```
|
34
|
+
bun test
|
35
|
+
```
|