DB access without object-relation mapping?

K

kj

Python noob here.

I want to write a script that creates and populates a simple Postgres
database.

The word on the street is to use something like SQLAlchemy for
database access in Python, but my experience in the past with
packages that perform automated SQL generation has been awful, so
I always return to lighter-weight solutions that allow me to write
my own SQL. (E.g. when coding in Perl I've used Perl's DBI package
and drivers, rather than the likes of Class::DBI.) So what's the
standard Python way to send SQL directly to a Postgres database
and get back results?

TIA!

kynn
 
T

Tim Henderson

Python noob here.

I want to write a script that creates and populates a simple Postgres
database.

The word on the street is to use something like SQLAlchemy for
database access in Python, but my experience in the past with
packages that perform automated SQL generation has been awful, so
I always return to lighter-weight solutions that allow me to write
my own SQL.  (E.g. when coding in Perl I've used Perl's DBI package
and drivers, rather than the likes of Class::DBI.)  So what's the
standard Python way to send SQL directly to a Postgres database
and get back results?

TIA!

kynn

Hi,

I believe there are a couple of options but pyscopg, and PyGreSQL seem
to be popular.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,244
Latest member
cryptotaxsoftware12

Latest Threads

Top