Questions tagged [pysqlite]

A DB-API2 compliant module in Python for interacting with a SQLite relational database.

140 questions
1
vote
2 answers

pysqlite user types in select statement

Using pysqlite how can a user-defined-type be used as a value in a comparison, e. g: “... WHERE columnName > userType”? For example, I've defined a bool type with the requisite registration, converter, etc. Pysqlite/Sqlite responds as expected for…
Strider1066
  • 101
  • 1
  • 5
1
vote
1 answer

Accessing the dot cli commands from sqlite in pysqlite

I'm looking to access the sqlite dot commands in pysql, particularly the .tables .schema .import commands. However, when I try: >>> db.execute(".tables") Traceback (most recent call last): File "", line 1, in…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
1
vote
1 answer

How do I enable transactional DDL in pysqlite?

I am using pysqlite which, by default, does not enable transactional DDL (although DDL is transactional from the sqlite3 client). How do I enable transactional DDL within pysqlite?
joeforker
  • 40,459
  • 37
  • 151
  • 246
1
vote
3 answers

Python pysqlite not accepting my qmark parameterization

I think I am being a bonehead, maybe not importing the right package, but when I do... from pysqlite2 import dbapi2 as sqlite import types import re import sys ... def create_asgn(self): stmt = "CREATE TABLE ? (login CHAR(8) PRIMARY KEY…
Overflown
  • 1,830
  • 2
  • 19
  • 25
1
vote
0 answers

Profiling sqlite3 using Python3's pysqlite

I have a Python program collecting monitoring data every second. Data will be buffered in a SQLite database for later transmission. Database scheme: unix_timestamp integer, device_id text, s0 integer, s1 integer, ..., s99 integer. And an index on…
troet
  • 23
  • 6
1
vote
1 answer

want to use panda to make it look/work like sql

pysql = lambda q: pdsql.sqldf(q, globals()) str1 = "select coalesce(ID1, H_ID, [Alternate Source Unique Identifier]) as Master_ID, [Alternate Source Unique Identifier] as Q_ID from crosswalk;" with Timer("Load master_ids:"): …
1
vote
2 answers

Trying to run Django tests, get error loading either pysqlite2 or sqlite3?

I am trying to run tests on a project that is not mine when i python manage.py test, I get raise ImproperlyConfigured("Error loading either pysqlite2 or sqlite3 modules (tried in that order): %s" % exc) django.core.exceptions.ImproperlyConfigured:…
RPG
  • 198
  • 9
1
vote
0 answers

SQLite: How to return a list of nodes in which traveling distance from one node to the next is the shortest (visiting only each node once)?

Problem statement: Given an initial bar position, return a list of bars in which the traveling distance from one bar to another is the shortest, without visiting the same bar twice. The table BAR_POS stores the following info of bars around my…
1
vote
0 answers

Upgrading pysqlite(sqlite3) module on windows

I'm trying to upgrade the builtin module pysqlite(sqlite3) on my windows 7, to the most recent version (currently 2.8.2). My python version is 2.7.10. When I run the pip commend on my cmd console, I get the following…
NI6
  • 2,477
  • 5
  • 17
  • 28
1
vote
1 answer

Pysqlite setup error

When intalling pysqlite on my Mac I get permission denied when it tries to create pysqlite2-doc dir. Any ideas why?
Fredr
  • 11
  • 1
1
vote
2 answers

sqlite usage and purpose

Could someone provide an examples about why sqlite db is needed and for which purposes, especially if it can be used by security application?
Joe
  • 989
  • 2
  • 8
  • 5
1
vote
1 answer

joining across databases with sqlite3 / pysqlite

I have two separate database files each with tables with matching primary keys, but different data. I want to pull out rows from one table based on values in the other. In the CLI for sqlite3, I would do this like: .open data.db .open…
Ian Fiddes
  • 2,821
  • 5
  • 29
  • 49
1
vote
1 answer

SQL Query in pandas python

I am writing an SQL query in python pandas: import pandas as pd from pandas import DataFrame, read_csv import numpy as np from pandasql import sqldf pysqldf=lambda q:sqldf(q,globals()) rolup = pysqldf(u"select MasterUserId,DeviceUsed,hcluster,…
Pulkit Jha
  • 1,709
  • 3
  • 12
  • 18
1
vote
1 answer

Using a Variable Number of WHERE Clauses to Match an Arbitrary Number of Keywords pysqlite

I'm using pysqlite to build and search through a database of keywords + sets of URLs which correspond to each keyword. My strategy for searching the database works fine with 1 keyword, since it only requires 1 WHERE clause in the SQL statement.…
Qdox
  • 13
  • 2
1
vote
0 answers

How can I deploy to cloudcontrol a python app that requires pysqlite?

I have a python web app that depends on the pysqlite module but pushing it to cloudcontrol fails with error remote: src/connection.h:33:21: fatal error: sqlite3.h: No such file or directory Is there any way to get that app running on…
Thomasleveil
  • 95,867
  • 15
  • 119
  • 113