An open API service indexing awesome lists of open source software.

https://github.com/dgapitts/vagrant-sqlalchemy


https://github.com/dgapitts/vagrant-sqlalchemy

Last synced: 8 months ago
JSON representation

Awesome Lists containing this project

README

          

# vagrant-sqlalchemy

## Intro

This project is to explore and demo the python sqlalchemy ORM

SQLAlchemy is the Python SQL toolkit and Object Relational Mapper that gives application developers the full power and flexibility of SQL. It provides a full suite of well known enterprise-level persistence patterns, designed for efficient and high-performing database access, adapted into a simple and Pythonic domain language...
SQLAlchemy is most famous for its object-relational mapper (ORM), an optional component that provides the data mapper pattern, where classes can be mapped to the database in open ended, multiple ways - allowing the object model and database schema to develop in a cleanly decoupled way from the beginning.
https://www.sqlalchemy.org/

I'm going working with a few DB engines: postgres, sqlite, cockroachdb and mysql.

## General data generation and first steps with sqlite3 (initially without sqlalchemy)

While the schema will be generated by sqlalchemy, I'm hoping to allign with pg_bench for easy/simple data generation - see [docs/data-setup.md](docs/data-setup.md)

## Starting sqlalchemy ORM

As per [docs/intro-sqlalchemy.md](docs/intro-sqlalchemy.md):
* I do sfollow some first steps woth sqlalchemy ORM
* This hello customer-table world style example uses sqlite3

As per [docs/intro-sqlalchemy-python.md](docs/intro-sqlalchemy-python.md)
* I can also use the ORM in the same manner in postgres

## Background vagrant issues and tweaks

### Vagrant scp

* As per [docs/vagrant-scp.md](docs/vagrant-scp.md) I've made some notes on setting up scp with vagrant, as the initial datasets are created in pgbench/postgres, then dumped to flat files and tweaked for the other db engines.
* These tweaks will be largely scripted plus a few final quick manual edits.
* I'm planning to use vagrant-scp to save these datasets i.e. back to the project.

### Vagrant mount failures and my workaround - vagrant reload && sudo /vagrant/post-provision.sh

* I'm not sure why recently I'm hitting /vagrant mount issues around initial provisioning?
* However it appears that I'm alone and I have made some notes regarding workarounds [docs/vagrant-mount-issues.md](docs/vagrant-mount-issues.md).