Skip to content

Commit

Permalink
Use parameters in all SQL statements
Browse files Browse the repository at this point in the history
Fixes #89
  • Loading branch information
Heiko Nickerl committed Jun 21, 2018
1 parent 7fc13b2 commit 57dbe0a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Changelog

## v0.13.3: June 21, 2018
##### Bugfixes
- Instead of crashing, fail gracefully when yanking current path on systems without clipboard
- Fix handling of entries which contain special characters

## v0.13.2: June 20, 2018
##### Features
- Install documentation to general doc directory
##### Bugfixes
- Explicitly specify v3.6 as python version
- Instead of crashing, fail gracefully when yanking current path on systems without clipboard

## v0.13.1: June 20, 2018
##### Bugfixes
Expand Down
6 changes: 4 additions & 2 deletions sodalite/core/dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,14 @@ def insert_new_entries(entries_fs: Dict[str, Entry], entries_db: Dict[str, Entry
for entry in reassigned_old_entries:
update_entry(entry)
query = f"INSERT INTO {TABLE_ENTRY} VALUES "
parameters = []
for entry in new_entries.values():
query += "('{}','{}'),".format(entry.path, entry.key.value)
query += "(?,?),"
parameters += [entry.path, entry.key.value]
query = query[:-1] + ';'
conn = open_connection()
try:
conn.cursor().execute(query)
conn.cursor().execute(query, (*parameters,))
conn.commit()
except sqlite3.IntegrityError:
logger.error("Integrity error. failed to insert at least one of " + str(new_paths))
Expand Down
2 changes: 1 addition & 1 deletion sodalite/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

logger = logging.getLogger(__name__)

VERSION = 'sodalite v0.13.2'
VERSION = 'sodalite v0.13.3'

def _io_to_tty():
global _old_stdin
Expand Down

0 comments on commit 57dbe0a

Please sign in to comment.