bind dictionary params will crash

Open
#978 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
sqlite, swift
Domain
databases

Research direction

Start by reproducing the issue with the dictionary-parameter prepare call shown in the report, then compare it with the working positional-parameter call. Inspect the prepare path for named bindings; done means dictionary parameters no longer crash while the existing positional form continues to work.

Written by the indexing model from the issue text.

Description

bug

If I select use
try! connect?.prepare("SELECT * FROM words WHERE category=:category AND language=:language ORDER BY RANDOM()", ["category":category, "language":language])
it will crash, like this
76F3D71E-D6A8-4F6F-9C7E-BD9CD5AF8CA7

But use
try! connect?.prepare("SELECT * FROM words WHERE category=? AND language=? ORDER BY RANDOM()", [category, language])
it‘s OK

Dominant language
Swift
Stars
10.2k
Forks
1.6k
Avg merge
6d 2h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stephencelis/SQLite.swift

All issues in stephencelis/SQLite.swift

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.