6 votes
Accepted

Mapping named parameters to indices for PreparedStatement

Name of the class doesn't indicate its purpose. The class is called "ParameterMap" but its use-case (filling in values in a query) doesn't need to know about it having a map somewhere inside ...
QuasiStellar's user avatar
  • 2,239
4 votes

Mapping named parameters to indices for PreparedStatement

commenting var index = 1 // <-- JDBC starts counting with 1 Thank you for the one-origin reminder, that's a helpful comment. ...
J_H's user avatar
  • 25.1k
3 votes

Improving efficiency of database searches under SQLite (SpatiaLite - QGIS)

I've always heard that[SQL] is a very efficient way of searching databases. Yes. It can be. When used carefully. try and improve the execution speed of my triggers To be clear, procedural logic ...
J_H's user avatar
  • 25.1k
3 votes

Concurrently write results to SQLite database

General Approach From what I have personally experienced and from what I have read on the Internet, doing concurrent writes to a SQLite database either from multiple threads or multiple processes is ...
Booboo's user avatar
  • 1,636
2 votes
Accepted

Simple Connection Pool for SQLite in Python

I would make a few suggestions. The last two, listed separately, may be of marginal value to you and do increase the complexity of the code considerably. I have included a sample implementation that ...
Booboo's user avatar
  • 1,636
2 votes

PasteBin API scraper for new public pastes that appear at regular intervals

There is no need to initialize an array to an empty list when declaring the variable: my @flaggedRegex = (); This is simpler and cleaner: ...
toolic's user avatar
  • 3,223
2 votes

SQLite querybuilder class in python

It's good that there is some logging built-in, but this is not the right way to do it. It is inflexible: the output goes to a file (console is useful for debugging) and the format cannot even be ...
Kate's user avatar
  • 6,550
2 votes

SQLite querybuilder class in python

version use Python 3.6 I'm still not believing the constraint, given that interpreter should come from a venv rather than from /usr/bin, but fine, let's roll with ...
J_H's user avatar
  • 25.1k
1 vote

Improving efficiency of database searches under SQLite (SpatiaLite - QGIS)

I have grouped my databases. Now I have BDC_STAT and BD_TAXREF to search into. I like this way because I don't have to specify the value in the field "COMPART". It is more practical. But in ...
Giene's user avatar
  • 149
1 vote
Accepted

Managing users via SQLAlchemy DB model (updated)

The with looks good. operator = Operator(username=username, privilage=privilage) nit: Please use conventional spelling ...
J_H's user avatar
  • 25.1k
1 vote
Accepted

My Drawing Finder

informative identifier namespace Finder Maybe a bit on the vague side? Consider DrawingFinder or even ...
J_H's user avatar
  • 25.1k
1 vote

Python Django image upload API with 6 fixed slots

more efficient ways to write this code out for both increased readability, maintainability ? My goodness! Bet your keyboard looks like [Z][X][C][ ][B], with the <...
J_H's user avatar
  • 25.1k
1 vote

Mapping named parameters to indices for PreparedStatement

This: map.computeIfPresent(key) { _, indexes -> indexes.plus(index++) } map.computeIfAbsent(key) { mutableListOf(index++) } can be simplified to: ...
Tenfour04's user avatar
  • 813

Only top scored, non community-wiki answers of a minimum length are eligible