Questions tagged [apsw]

APSW is a thin Python wrapper over the SQLite API.

APSW is not fully compatible with Python's DBAPI in order to completely support all SQLite features.

References

37 questions
1
vote
1 answer

In APSW why does this sql binding not work

So why does this work: sql="""UPDATE """+stream+"""_pointer SET id = """+str(message.id)+"""; insert into """+stream+""" VALUES ("""+str(message.id)+""",'"""+safemessage+"""','pending')""" cursor.execute(sql) but with exactly the same variables…
1
vote
1 answer

Fetch All in APSW

You know there isn't any "fetchall" method for APSW. We can only use .next() method. So How can I take the result of an execute command with select query into a list?
Shansal
  • 1,369
  • 5
  • 16
  • 26
1
vote
1 answer

Insert datetime entry into table with TIMESTAMP data type

I am trying to create a system (with a discord bot, but that's not relevant to this) where it lists infractions of a user, like when it happened, where, why, etc. and I want a "date" datatype that logs the timestamp that it happened. I tried having…
Tauxxy
  • 49
  • 6
1
vote
2 answers

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe2 in position 105: invalid continuation byte

My code is pretty much the following : import sqlitefts as fts connection = apsw.Connection('texts.db', flags=apsw.SQLITE_OPEN_READWRITE) c = connection.cursor() def do_search(query): c.execute('SELECT title, book, author, link,…
Ram Charran
  • 131
  • 1
  • 3
  • 14
1
vote
2 answers

Alternative to Connection.iterdump for SQLite in Python?

I found a function that will help me load a disk SQLite database to a memory database, but have found that the module I need, apsw, doesn't support it, while pysqlite does. I need apsw because it has most of the functions I need that pysqlite does…
Clay
  • 11
  • 1
1
vote
1 answer

How to create multiple complex sqlite transactions with an expected out using apsw?

I want to execute several complex statements in a transaction with a select statement at the end which I use for further processing. Doing so once works fine but as soon as I execute the same statement again it causes the error below. Test…
Fabian Barkhau
  • 1,349
  • 2
  • 12
  • 31
1
vote
1 answer

QLite and Concurrency across multiple computers with Python 2.7

I have a program that multiple computers will be running that all need to read/write from the same SQLite database. Each program is performing an action on a file and it requests an "available" file name from a list stored in an SQLite table. At…
njfrazie
  • 91
  • 1
  • 14
1
vote
1 answer

Python SQLite Wrapper apsw-3.7.16.2 failed to install in mac os x (10.7.5)

Failed to install sqlite wrapper. Any help with installation will be really helpful. Downloaded from Installed sqlite3.version '2.6.0' Please find the error log below- sudo python setup.py install test running install running build running…
TJC
  • 43
  • 5
1
vote
2 answers

Trigger Django module on Database update

I want to develop an application that monitors the database for new records and allows me to execute a method in the context of my Django application when a new record is inserted. I am planning to use an approach where a Celery task checks the…
user1908488
  • 189
  • 3
  • 9
0
votes
1 answer

How to compile Python APSW with local build os SQLite

I'm developing an application and I would like to compile SQLite with some personalized flags and use this build of SQLite with APSW! To be more specific, I would like to use the options in the Recommended Compile-time Options section of SQLite…
0
votes
1 answer

why does apsw cursor.execute(sql, (vars)) break outer for loop

So I have the following code: with closing(connection.cursor()) as cursor: for row in cursor.execute("select *, rowid from positions where status = 'pending'"): print(row[11]) x=2 if (row[9])!='': x=3 …
0
votes
1 answer

How to escape a sequence argument in sql source in APSW?

I am rewriting source code from mysql to sqlite and don't know how to escape a sequence argument in APSW driver: cur.execute(""" select * from users where user_id in ? """, [[1, 2, 3]]) It is definitely a very basic need and it works…
tlama
  • 607
  • 1
  • 10
  • 17
0
votes
1 answer

Return rows changed on UPDATE sequence

I am trying to return what rows are used in my UPDATE sequence, to check if it actually updated anything or it tried updating a nonexistent row, but I am having trouble getting the actual rows returned Upon asking friends and viewing other articles,…
Tauxxy
  • 49
  • 6
0
votes
1 answer

How to share a :memory: database between different process in python using python sqlite3 package

scenario is shown as below,i got many processes to do CPU-bound work and read only on the same database,i know cache and uri key words could be used for sqlite to share database cache between threads,but how about between processes?it's better to be…
RTY
  • 5
  • 3
0
votes
0 answers

Why is there a segmentation fault with this code?

I couldnt find the tag for apsw module. import sqlitefts as fts import os from search import * from search import OUWordTokenizer import sys def tokenize(): with apsw.Connection('texts.db', flags=apsw.SQLITE_OPEN_READWRITE) as connection: …
Ram Charran
  • 131
  • 1
  • 3
  • 14