Skip to main content

A utility package for sql work

Project description

talksql

Examples

ipcfg = {
    'user': '',
    'password': '',
    'host': '',
	'db':'' }

cfg = { 'socket':"/tmp/mysql.sock",
    'user': '',
    'password': '',
    'host': '',
	'db':'' }

from talksql import *
con = ipconnect(ipcfg) #or
con = sockconnect(cfg)
#con is mysql connector connection object

Get a resultset

from talksql import *
sql="select * from table where .." 
rs,c = xecrs(con,sql)
#rs is array for rows and columns of resultset
#c is cursor mysql connection 
# - go to mysql connector if you have to use the cursor to iterate
#this works unless you need to deal with large datasets

Sub data and get a resultset

from talksql import *
sql="select * from table where column=%s"
data=(value,)
#data is %s sub-ed  
rs,c = xecrs(con,sql,data)
from talksql import *
sql="delete from table"
#data is %s sub-ed if given like resultset  
c = xec(con,sql)
#c is the cursor

Few more

sqlaofa, sqlaofd are experimental and only works as string data

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

talksql-1.2.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

talksql-1.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file talksql-1.2.tar.gz.

File metadata

  • Download URL: talksql-1.2.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for talksql-1.2.tar.gz
Algorithm Hash digest
SHA256 69eb1ec3882e6edb5d4a1542eb904911269c11c650f3dba598f9202d3b5264a0
MD5 fd6708c1e230bfeac0449f6239126445
BLAKE2b-256 5b15fd8014b9fc03f1fc1c19aacc0993c3fbadea919e1dad3669b2f1ec19648e

See more details on using hashes here.

File details

Details for the file talksql-1.2-py3-none-any.whl.

File metadata

  • Download URL: talksql-1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

File hashes

Hashes for talksql-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a23f71b2ca599f6197e314c1032cb05c92490e99f344f71e6bf8fd57ce20c56
MD5 963b1fa915845974216ada10f9bf8bea
BLAKE2b-256 03dc5ea4a4100d208a65728a8c8bcaf6a23d834f3de2d639c95fbd9cc2ac05a9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page