Skip to content


How to Load SQL File to Database

It would be nice to have the possibility of loading an sql file to database using normal database api. OK, let’s define what the ‘normal api’ is. This should be a full featured api for connecting to database and performing queries, with many drivers available. My favourite ones are: JDBC and DBI (yes, the one from Perl).
Unfortunately Python doesn’t have any. Python’s DBAPI 2.0 is a kind of joke, not API.

Another problem is that there isn’t any way to load an sql file into the database. The only workaround that I found is to use an external program like: ‘psql < file.sql’. But this is not the way an API should work.

Related posts:

  1. How to Allow For Max 4 Rows in Update (PostgreSQL) The Problem Question found on the net: how to restrict...
  2. Trying to Use Database in Python Why the f**** there is nothing like DBI in Python?...
  3. Testing Database – Small Reply On Ovid’s blog I found lately this entry. First of...

Posted in programming.

Tagged with .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.



Better Tag Cloud