https://github.com/hackersandslackers/sqlalchemy-tutorial
๐งช๐ฌ Use SQLAlchemy to connect, query, and interact with relational databases.
https://github.com/hackersandslackers/sqlalchemy-tutorial
database database-management orm-framework orms python sqlalchemy sqlalchemy-orm sqlalchemy-python tutorial
Last synced: 17 days ago
JSON representation
๐งช๐ฌ Use SQLAlchemy to connect, query, and interact with relational databases.
- Host: GitHub
- URL: https://github.com/hackersandslackers/sqlalchemy-tutorial
- Owner: hackersandslackers
- Created: 2020-12-28T00:51:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-03-29T12:02:47.000Z (24 days ago)
- Last Synced: 2025-03-30T02:07:19.933Z (24 days ago)
- Topics: database, database-management, orm-framework, orms, python, sqlalchemy, sqlalchemy-orm, sqlalchemy-python, tutorial
- Language: Python
- Homepage: https://hackersandslackers.com/python-database-management-sqlalchemy/
- Size: 192 KB
- Stars: 94
- Watchers: 3
- Forks: 27
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# SQLAlchemy Tutorial




[](https://github.com/hackersandslackers/sqlalchemy-tutorial/issues)
[](https://github.com/hackersandslackers/sqlalchemy-tutorial/stargazers)
[](https://github.com/hackersandslackers/sqlalchemy-tutorial/network)
This repository contains the source code for a four-part tutorial series on SQLAlchemy:
1. [Databases in Python Made Easy with SQLAlchemy](https://hackersandslackers.com/python-database-management-sqlalchemy)
2. [Implement an ORM with SQLAlchemy](https://hackersandslackers.com/implement-sqlalchemy-orm)
3. [Relationships in SQLAlchemy Data Models](https://hackersandslackers.com/sqlalchemy-data-models)
4. [Constructing Database Queries with SQLAlchemy](https://hackersandslackers.com/database-queries-sqlalchemy-orm)## Getting Started
Get set up locally in two steps:
### Environment Variables
Replace the values in **.env.example** with your values and rename this file to **.env**:
* `DATABASE_USERNAME`: Username for a SQL database.
* `DATABASE_PASSWORD`: Corresponding password for the above SQL database user.
* `DATABASE_HOST`: Host of the SQL database.
* `DATABASE_PORT`: Numerical port of the SQL database.
* `DATABASE_TABLE`: Name of the SQL database table.
* `DATABASE_CERT_FILE` _(optional)_: Path to SSL certificate file for database.*Remember never to commit secrets saved in .env files to Github.*
### Installation
Get up and running with `make run`:
```shell
git clone https://github.com/hackersandslackers/sqlalchemy-tutorial.git
cd sqlalchemy-tutorial
make run
```-----
**Hackers and Slackers** tutorials are free of charge. If you found this tutorial helpful, a [small donation](https://www.buymeacoffee.com/hackersslackers) would be greatly appreciated to keep us in business. All proceeds go towards coffee, and all coffee goes towards more content.