Aliased NOT EXISTS and an aliased column as part of SELECT

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

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
sql, sqlite, swift
Domain
database

Research direction

Start by reviewing the tests and source files mentioned in the issue to see how the library currently expresses SELECT subqueries, aliases, COUNT, and NOT EXISTS. Determine whether these query forms are supported and what API shape would be needed; done means providing a confirmed example or a defined feature with tests covering the requested query.

Written by the indexing model from the issue text.

Description

Is there a way to express the following query with the help of the library?

SELECT
  expo.id AS expo_id,
  (SELECT COUNT(*) FROM lead) lead_count,
  NOT EXISTS(SELECT * FROM lead WHERE result <> 1) leads_synced
FROM expo

If so, then could you give an example? After looking at the tests and skimming through the sources, I don't believe it's currently possible though. Maybe something for the future releases then.

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.