Readme update

This commit is contained in:
Adrien Bouvais 2024-10-02 20:00:19 +02:00
parent 87f070231e
commit 61f2363f8f

View File

@ -68,6 +68,32 @@ Comment {
} }
``` ```
Can be simplify to take less space but can require more complexe query:
```
User {
name: str,
email: str,
friends: []User,
posts: []Post,
comments: []Comment,
}
Post {
title: str,
image: str,
at: date,
like_by: []User,
comments: []Comment,
}
Comment {
content: str,
at: date,
like_by: []User,
}
```
Note: [] are list of value. Note: [] are list of value.
# ZipponQL # ZipponQL
@ -76,53 +102,33 @@ Zippon have it's own query language. Here the keys point to remember:
- {} Are filters - {} Are filters
- [] Are how much; what data - [] Are how much; what data
- () Are new or updated data (Not already in file) - () Are new or updated data (Not already in file); Or to link condition between {}
- || Are additional options - || Are additional options
- Link need to be specify between [] to be return, other are returned automatically - By default all member that are not link are return
- Data are in struct format and can have link - To return link or just some member, specify them between []
### Some examples ## Examples
| Command | Description |
`GRAB User` | --- | --- |
Get all users | GRAB User | Get all users |
| GRAB User { name = 'Adrien' } | Get all users named Adrien |
`GRAB User { name = 'Adrien' }` | GRAB User [1; email] | Get one user's email |
Get all user named Adrien | GRAB User | ASCENDING name | | Get all users ordered by name |
| GRAB User [name] { age > 10 AND name != 'Adrien' } | DECENDING age | | Get just the name of all users that are more than 10 years old and not named Adrien |
`GRAB User [1; email]` | GRAB User [1] { bestfriend = { name = 'Adrien' } } | Get one user that has a best friend named Adrien |
Get one user email | GRAB User [10; friends [1]] { age > 10 } | ASC name | | Get one friend of the 10th user above 10 years old in ascending name |
`GRAB User | ASCENDING name |`
Get all users ordered by name
`GRAB User [name] { age > 10 AND name != 'Adrien' } | DECENDING age |`
Get just the name of all users that are more than 10 years old and not named Adrien
`GRAB User [1] { bestfriend = { name = 'Adrien' } }`
Get one user that have a best friend named Adrien
`GRAB User [10; friends [1]] { age > 10 } | ASC name |`
Get one friend of the 10 first user above 10 years old in ascending name.
### Not yet implemented ### Not yet implemented
| Command | Description |
`GRAB Message [100; comments [ date ] ] { .writter = { name = 'Adrien' }.bestfriend }` | --- | --- |
Get the date of 100 comments written by the best friend of a user named Adrien | GRAB Message [100; comments [ date ] ] { .writter = { name = 'Adrien' }.bestfriend } | Get the date of 100 comments written by the best friend of a user named Adrien |
| GRAB User { IN Message { date > '12-01-2014' }.writter } | Get all users that sent a message after the 12th January 2014 |
`GRAB User { IN Message { date > '12-01-2014' }.writter }` | GRAB User { !IN Comment { }.writter } | Get all users that didn't write a comment |
Get all users that sended a message after the 12 january 2014 | GRAB User { IN User { name = 'Adrien' }.friends } | Get all users that are friends with an Adrien |
| UPDATE User [1] { name = 'Adrien' } => ( email = 'new@email.com' ) | Update a user's email |
`GRAB User { !IN Comment { }.writter }` | REMOVE User { id = '000-000' } | Remove a user by ID |
Get all user that didn't wrote a comment | ADD User ( name = 'Adrien', email = 'email', age = 40 ) | Add a new user |
Let me know if you'd like me to make any further changes!
`GRAB User { IN User { name = 'Adrien' }.friends }`
Get all user that are friends with an Adrien
`UPDATE User [1] { name = 'Adrien' } => ( email = 'new@email.com' )`
`REMOVE User { id = '000-000' }`
`ADD User ( name = 'Adrien', email = 'email', age = 40 )`
# Integration # Integration
@ -146,7 +152,7 @@ for user in users:
# Roadmap # Roadmap
[X] CLI [X] CLI
[ ] Beta without link [ ] Parser basic
[ ] Relationships/links [ ] Relationships/links
[ ] Multi threading [ ] Multi threading
[ ] Transaction [ ] Transaction