Skip to content

Commit

Permalink
Add basic usage info to readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
scragly committed Mar 26, 2021
1 parent 07ab759 commit d765172
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
# everstone

The simple database query generator.
A simple database query generator.


### This project is still in active develpment and is not ready of usage.

## Installation
```sh
pip install everstone
```

**Requires Python 3.9.0+**

## Usage

### Connecting a Database
```py
from everstone import db

db.connect("test_database", "user_one", "abcd5432")
```

### Creating a Schema:

```python
from everstone import db

auth_schema = db.Schema("auth")
await auth_schema.create()
```
#### Resulting SQL
```sql
CREATE TABLE user (user_id INTEGER PRIMARY KEY, name TEXT);
```

### Creating a Table:

```py
from everstone import constraints, db, types
from everstone import Column
user_table = db.Table("user")
user_table.add_columns(
Column("user_id", types.Integer, constraints.PrimaryKey),
Column("name", types.Text)
)
await user_table.create()
```
#### Resulting SQL
```sql
CREATE TABLE user (user_id INTEGER PRIMARY KEY, name TEXT);
```

0 comments on commit d765172

Please sign in to comment.