Skip to content

Commit

Permalink
Declare supported UNION features (#96)
Browse files Browse the repository at this point in the history
* Declare (and require) support for the new union feature flags.
* Quick CI update, not very comprehensive, just get it running something vaguely recent
  • Loading branch information
gwynne authored Dec 14, 2021
1 parent 28f0548 commit 0b3b12b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 48 deletions.
72 changes: 25 additions & 47 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: test
on:
pull_request:
push:
branches:
- master
push: { branches: [ main ] }
defaults:
run:
shell: bash
jobs:
dependents:
runs-on: ubuntu-latest
container: swift:5.2-bionic
container: swift:5.5-focal
strategy:
fail-fast: false
matrix:
Expand All @@ -19,73 +17,53 @@ jobs:
steps:
- name: Install dependencies
run: apt-get -q update && apt-get -q install -y libsqlite3-dev
- name: Check out SQLiteKit
- name: Check out package
uses: actions/checkout@v2
with:
path: sqlite-kit
path: package
- name: Check out dependent
uses: actions/checkout@v2
with:
repository: vapor/${{ matrix.dependent }}
path: dependent
ref: main
- name: Use local package
run: swift package edit sqlite-kit --path ../sqlite-kit
run: swift package edit sqlite-kit --path ../package
working-directory: dependent
- name: Run tests with Thread Sanitizer
run: swift test --enable-test-discovery --sanitize=thread
working-directory: dependent
linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
# 5.2 Stable
- swift:5.2-xenial
- swift:5.2-bionic
# 5.2 Unstable
- swiftlang/swift:nightly-5.2-xenial
- swiftlang/swift:nightly-5.2-bionic
# 5.3 Unstable
- swiftlang/swift:nightly-5.3-xenial
- swiftlang/swift:nightly-5.3-bionic
# Master Unsable
- swiftlang/swift:nightly-master-xenial
- swiftlang/swift:nightly-master-bionic
- swiftlang/swift:nightly-master-focal
- swiftlang/swift:nightly-master-centos8
- swiftlang/swift:nightly-master-amazonlinux2
container: ${{ matrix.image }}
runner:
- swift:5.2-focal
- swift:5.5-focal
- swiftlang/swift:nightly-main-focal
container: ${{ matrix.runner }}
runs-on: ubuntu-latest
steps:
- name: Install Ubuntu dependencies
- name: Install dependencies
run: apt-get -q update && apt-get -q install -y libsqlite3-dev
if: ${{ endsWith(matrix.image, 'xenial') || endsWith(matrix.image, 'bionic') || endsWith(matrix.image, 'focal') }}
- name: Install CentOS deps
run: dnf install -y sqlite-devel
if: ${{ endsWith(matrix.image, 'centos8') }}
- name: Update AmazonLinux2's too-old SQLite and compensate for its Postgres
if: ${{ endsWith(matrix.image, 'amazonlinux2') }}
working-directory: /root
# Cribbed from the Fedora RPM, leaves out a lot. System's Tcl is too old to run SQLite's tests.
run: |
yum install -y sqlite-devel
yum install -y file tcl-devel make
curl -L 'https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release' | tar xz && cd sqlite
export CFLAGS="-DSQLITE_DISABLE_DIRSYNC=1 -DSQLITE_SECURE_DELETE=1"
./configure --prefix=/usr --libdir=/usr/lib64 --enable-fts3 --enable-all --with-tcl=/usr/lib64
make all install
- name: Checkout code
- name: Check out code
uses: actions/checkout@v2
- name: Run tests with Thread Sanitizer
run: swift test --enable-test-discovery --sanitize=thread
macOS:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
version:
- latest
- latest-stable
runs-on: macos-11
steps:
- name: Select latest available Xcode
uses: maxim-lobanov/setup-xcode@1.0
with:
xcode-version: latest
- name: Checkout code
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.version }}
- name: Check out code
uses: actions/checkout@v2
- name: Run tests with Thread Sanitizer
run: swift test --enable-test-discovery --sanitize=thread
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/vapor/sqlite-nio.git", from: "1.0.0"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.0.0"),
.package(url: "https://github.com/vapor/sql-kit.git", from: "3.16.0"),
.package(url: "https://github.com/vapor/async-kit.git", from: "1.0.0"),
],
targets: [
Expand Down
4 changes: 4 additions & 0 deletions Sources/SQLiteKit/SQLiteDialect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,9 @@ public struct SQLiteDialect: SQLDialect {
return .init(create: [.supportsBody, .supportsCondition])
}

public var unionFeatures: SQLUnionFeatures {
[.union, .unionAll, .intersect, .except]
}

public init() { }
}

0 comments on commit 0b3b12b

Please sign in to comment.