Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b56e06
commit 65b0992
Showing
12 changed files
with
128 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# aio-users | ||
|
||
This example demonstrates how to create a simple database in a standalone | ||
Python script that is based on the `asyncio` module. | ||
|
||
## Usage | ||
|
||
To try this example, install `alchemical` and then run the code as follows: | ||
|
||
```bash | ||
$ python users.py | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# fastapi-multi-db | ||
|
||
This example demonstrates how to manage multiple databases in a FastAPI | ||
application using Alchemical. | ||
|
||
## Usage | ||
|
||
To try this example, install `alchemical` and `uvicorn`, and then run the | ||
following commands: | ||
|
||
```bash | ||
$ python app.py init # initialize the database | ||
$ python app.py add # add user and group to the db | ||
$ uvicorn --port 5000 app:app # start the fastapi application | ||
``` | ||
|
||
Once the FastAPI application is running, open `http://localhost:5000` in your | ||
web browser to see the contents of the database. You can invoke the `add` | ||
command additional times to insert more users and groups into the database. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# fastapi-single-db | ||
|
||
This example demonstrates how to manage a database in a FastAPI application | ||
using Alchemical. | ||
|
||
## Usage | ||
|
||
To try this example, install `alchemical` and `uvicorn`, and then run the | ||
following commands: | ||
|
||
```bash | ||
$ python app.py init # initialize the database | ||
$ python app.py add # add a user to the database | ||
$ uvicorn --port 5000 app:app # start the fastapi application | ||
``` | ||
|
||
Once the FastAPI application is running, open `http://localhost:5000` in your | ||
web browser to see the contents of the database. You can invoke the `add` | ||
command additional times to insert more users into the database. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# flask-multi-db | ||
|
||
This example demonstrates how to manage multiple databases in a Flask | ||
application using Alchemical and Flask-Migrate. | ||
|
||
## Usage | ||
|
||
To try this example, install `alchemical`, `flask` and `flask-migrate`, and | ||
then run the following commands: | ||
|
||
```bash | ||
$ flask db init --multidb # initialize a migration repository | ||
$ flask db migrate -m "initial migration" # create a database migration | ||
$ flask db upgrade # apply the migration changes | ||
$ flask add # add user and group to the db | ||
$ flask run # start the Flask application | ||
``` | ||
|
||
Once the Flask application is running, open `http://localhost:5000` in your | ||
web browser to see the contents of the database. You can invoke the `flask add` | ||
command additional times to insert more users and groups into the database. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# flask-single-db | ||
|
||
This example demonstrates how to manage a database in a Flask application using | ||
Alchemical and Flask-Migrate. | ||
|
||
## Usage | ||
|
||
To try this example, install `alchemical`, `flask` and `flask-migrate`, and | ||
then run the following commands: | ||
|
||
```bash | ||
$ flask db init # initialize a migration repository | ||
$ flask db migrate -m "initial migration" # create a database migration | ||
$ flask db upgrade # apply the migration changes | ||
$ flask add # add a user to the database | ||
$ flask run # start the Flask application | ||
``` | ||
|
||
Once the Flask application is running, open `http://localhost:5000` in your | ||
web browser to see the contents of the database. You can invoke the `flask add` | ||
command additional times to insert more users into the database. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# multi-db | ||
|
||
This example demonstrates how to manage multiple databases from a standalone | ||
Python script. | ||
|
||
## Usage | ||
|
||
To try this example, install `alchemical` and then run the code as follows: | ||
|
||
```bash | ||
$ python users_and_groups.py | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# users | ||
|
||
This example demonstrates how to create a simple database in a standalone | ||
Python script. | ||
|
||
## Usage | ||
|
||
To try this example, install `alchemical` and then run the code as follows: | ||
|
||
```bash | ||
$ python users.py | ||
``` |