Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sean committed Apr 26, 2023
1 parent 768eecc commit 71d5410
Showing 1 changed file with 59 additions and 13 deletions.
72 changes: 59 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# YeSQL
# yesql

[![image](https://img.shields.io/pypi/v/yesql.svg)](https://pypi.org/project/yesql/)
[![image](https://img.shields.io/pypi/l/yesql.svg)](https://pypi.org/project/yesql/)
Expand All @@ -9,17 +9,36 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)


Say YES to SQL with YeSQL. YeSQL eliminates boilerplate without the baggage of an
expensive or clunky ORM. Simply write your SQL and point YeSQL to the directory, and it
does all the rest.
Say _yes_ to _SQL_ with **yesql**.

## Quickstart
yesql eliminates boilerplate without the baggage of an expensive or clunky ORM.
Simply write your SQL, point yesql to the directory, and it does all the rest.

## Quickstart

### Installation

```shell
pip install -U yesql
pip install -U --pre yesql
```
or
```shell
poetry add --allow-prereleases yesql
```

yesql currently supports the following database drivers:

- [asyncpg][1]
- [psycopg][2]

You can select your driver as an extra when installing yesql _(recommended)_:

```shell
pip install -U --pre "yesql[psycopg]"
```
or
```shell
poetry add --allow-prereleases yesql -E asyncpg
```

### Basic Usage
Expand Down Expand Up @@ -75,19 +94,41 @@ saved_post = posts.create(instance=new_post)

#### Type-stub Generation (Experimental)

YeSQL ships with simple CLI for generating type-stubs. This allows for more exact
yesql ships with simple CLI for generating type-stubs. This allows for more exact
static type-analysis and enables auto-complete for your IDE.

Usage:

```shell
yesql stubgen
```

You can optionally supply any number of paths to directories or python modules. The
command will default to the current working directory on the filesystem.

If you don't have [black][3] installed in your development environment, you should add
the `cli` extra as a development dependency.

## Features

- [x] Support for synchronous IO
- [x] Support for asynchronous IO (asyncio)
- [x] Support for PostgreSQL
- [x] Plays well with MyPy
- [x] Plays well with IDEs
- [x] Encourages best-practices for data-access (Separation of Concerns, Repository
Pattern)

## No ORMs?

1. *ORMs are bad for you.*
They are a leaky abstraction that cannot solve the problem they set out to do - which
is to abstract out the details of working with a database.

2. *ORMs are slow.*
ORMs depend upon an extremely high level of abstraction in order to work consistently
across database clients. They also attempt to bridge the gap of data validation and
state management. By attempting to hide the details of managing state from the end
ORMs depend upon a high level of abstraction in order to work across database
clients. They also attempt to bridge the gap of data validation and state
management. By attempting to hide the details of managing state from the end
user, they suffer from large computational costs and predict

3. *ORMs are wasteful.*
Expand All @@ -103,9 +144,9 @@ static type-analysis and enables auto-complete for your IDE.
reasonable means of mitigation.


## Why YeSQL?
## Why yesql?

YeSQL takes a SQL-first approach to data management:
yesql takes a SQL-first approach to data management:

1. *Focus on your SQL and your database.*
- Reduce developer overhead by having one less middleman between you and your data.
Expand All @@ -131,7 +172,7 @@ YeSQL takes a SQL-first approach to data management:
- [ ] Full Test Coverage
- [ ] Dialect Support
- [x] Async PostgreSQL (via asyncpg & psycopg3)
- [ ] Async SQLite (via aiosqlite)
- [ ] Async SQLite
- [ ] Async MySQL
- [x] Sync PostgreSQL
- [ ] Sync SQLite
Expand All @@ -140,3 +181,8 @@ YeSQL takes a SQL-first approach to data management:
## License

[MIT](https://sean-dstewart.mit-license.org/)


[1]: https://magicstack.github.io/asyncpg/current/
[2]: https://www.psycopg.org/psycopg3/docs/
[3]: https://black.readthedocs.io/en/stable/

0 comments on commit 71d5410

Please sign in to comment.