GithubHelp home page GithubHelp logo

Comments (7)

Xarrow avatar Xarrow commented on September 17, 2024 1

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.

Xarrow avatar Xarrow commented on September 17, 2024

connect string like this :

 postgresql+pypostgresql://user:password@host:port/dbname[?key=value&key=value...]

you can get this refer by sqlAlchemy

from records.

timkofu avatar timkofu commented on September 17, 2024

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.

timofurrer avatar timofurrer commented on September 17, 2024

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.

timkofu avatar timkofu commented on September 17, 2024

Works. Thank you.

from records.

leafonsword avatar leafonsword commented on September 17, 2024

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.

leafonsword avatar leafonsword commented on September 17, 2024

@Xarrow
Thx, your example about PyMySQL works well!

from records.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.