Skip to content

numlims/dbcq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dbcq

dbcq is a little database connection and query wrapper for python.

db = dbcq("<target in .dbc>")
result = db.qfad("select * from table where name = ?", "adam")

documentation here.

install

download dbcq whl from here. install whl with pip:

pip install dbcq-<version>.whl

db connection

in your home directory, create a file named .dbc and fill in the connection info in the <> brackets like this:

[<db target name used in code>]
type = <mssql|sqlite>
database = <database name>
username = <user name>
password = <password>
server = <ip address>
port = <port>
driver = <path to db driver if needed>

for example:

[my_db]
type = mssql
database = my_db
username = hireader
password = ?hireaderpass?
server = 10.11.22.33
port = 1234
driver = /path/to/my/libmsodbcsql-18.3.so.2.1

if you're unsure where your home directory is, say dbcq to see where dbcq looks the .dbc file and put it there.

to get a list of the available pyodbc driver names for .dbc, run

dbcq --drivers

issues

what about DEFAULT in --targets?

what about pymysql driver?

About

db connect query

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages