apsw: Another Python SQLite Wrapper (github.com)

46 points by tosh 5 hours ago

13 comments:

by jph00 22 minutes ago

For anyone interested in an ergonomic API over this-- I ported sqlite-utils to apsw a while back: https://github.com/AnswerDotAI/apswutils

I've been using it a lot over the last year or two and it's worked great.

by Retr0id 3 hours ago

In a sentence, I'd say apsw is "the SQLite lover's SQLite library". The python stdlib one tries to provide a generic interface ("DBAPI") which is great if you want to be able to swap to a different database engine later, but it's bad for actually getting the most out of SQLite.

by overflowy 2 hours ago

Why do you say it's bad?

by Retr0id 2 hours ago

Everything to do with transactions, including nested transactions.

by arc-in-space 4 hours ago

This library is great, and recently saved a project of mine. Figuring out what was going on with some of python's sqlite3 quirks was too much of a hassle, meanwhile this more or less just worked the way I expected it to. Because of this experience I started defaulting to it over sqlite3 for other projects as well.

(This documentation page explains the library's intent: https://rogerbinns.github.io/apsw/pysqlite.html)

by biorach 4 hours ago

what quirks did you bump into with sqlite3?

by dex0shubham an hour ago

I was experimenting with APSW and I noticed that when a query doesn't return any row, it becomes difficult to get column names from the cursor, is there any recommended way to do this ?

by mont_tag 4 hours ago

Thank you HackerNews. I learned something new and will be using APSW for my next Sqlite project.

by scosman 4 hours ago

It’s a great wrapper, but we should add a year. Not exactly new.

by Retr0id 4 hours ago

The latest commit was 1 hour ago

by scosman 3 hours ago

ahh. It’s been around a while, but maybe the date convention is for articles not repos.

by arcanemachiner 3 hours ago

Abandonware!

by gjvc 2 hours ago

new to many people, just not you.

Data from: Hacker News, provided by Hacker News (unofficial) API