If you are using Python, I think you are using ** SqlAlchemy ** for DB processing without exception. However, SQLAlchemy is so unique that once you leave the project, you tend to forget the grammar.
To prevent this from happening this time, I'm always going to go back to this page and get started with SQLAlchemy right away.
The basic grammar is as follows. (For PostgreSQL)
from sqlalchemy import create_engine
engine = create_engine('dialect+driver://username:password@host:port/database')
Below is a list. User name, password and database name are tentative
# | DB name | Database URL |
---|---|---|
1 | MySQL | mysql://scott:tiger@localhost/foo |
2 | PostgreSQL | postgresql://scott:tiger@localhost/mydatabase |
3 | SqLite | sqlite:////absolute/path/to/foo.db' |
4 | Microsoft SQLServer(ODBC) | mssql+pyodbc://scott:tiger@mydsn |
4 | Microsoft SQLServer(Pymssql) | mssql+pymssql://scott:tiger@hostname:port/dbnam |
5 | Oracle | oracle://scott:[email protected]:1521/sidnam |
--2019/12/16 Newly created
Recommended Posts