Comments (7)
example for connecting mysql by using “pymysql” driver,
records.DATABASE_URL = "mysql+pymysql://user:password@host:port/db"
db = records.Database(echo=True)
i think record is based on SQLAlchemy , you can refer to the official document of SQLAlchemy and make expand
from records.
connect string like this :
postgresql+pypostgresql://user:password@host:port/dbname[?key=value&key=value...]
you can get this refer by sqlAlchemy
from records.
That's for a TCP/IP connection. Got somewhere showing a Unix socket connection string? Haven't found it in the docs so far.
from records.
It's in the docs right here.
If you are using psycopg2
you can omit the host
in your connection string. With that sqlalchemy will pass None
as the host argument to psycopg2
which will connect to the postgres server via UNIX socket.
from records.
Works. Thank you.
from records.
Hope records's readme has some example about connecting to MySQL or PG,;I was looking for a long time then found this issue then knows how to connect to MySQL
from records.
@Xarrow
Thx, your example about PyMySQL works well!
from records.
Related Issues (20)
- records.Database.query can't return affected rowcounts? HOT 1
- mssql query works for sqlalchemy but not for records HOT 1
- (sqlite3.ProgrammingError) Cannot operate on a closed database.
- Within transaction, the error disappeared HOT 1
- database connections
- Can I get multiple sql command's output
- 导出excel无异常情况,但是无法生成xls文件 HOT 1
- can not read sqlserver! data can be read using sqlalchemy but records no! HOT 2
- MSSQL Queries are broken
- Is records being maintained? HOT 3
- How to get the last sql run
- Export XLS error HOT 1
- This library may no longer be maintained, and many problems 1 year ago have not been dealt with HOT 6
- records python3 is not compatible with new sqlalchemy release 1.4.0 HOT 7
- records (v0.5.3) is incompatible with latest Pandas (v1.2.4) cause they have requires different openpyxl version dependency, is there any way to fix this issue? HOT 3
- db.query('SELECT * FROM persons) can't execute
- Records is not compatible with Python 3.8+ HOT 1
- sqlalchemy 2.0 support. HOT 1
- How to connect to oracle?Can you give me a demo?
- Would like to ask which Time Series Databases are supported
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from records.