All Projects → PL-Swift → PLSwift

PL-Swift / PLSwift

Licence: Apache-2.0 license
PostgreSQL Functions in Swift

Programming Languages

shell
77523 projects
Makefile
30231 projects
swift
15916 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to PLSwift

Pgrouting
Repository contains pgRouting library. Development branch is "develop", stable branch is "master"
Stars: ✭ 804 (+1961.54%)
Mutual labels:  postgresql-extension
Pg hashids
Short unique id generator for PostgreSQL, using hashids
Stars: ✭ 164 (+320.51%)
Mutual labels:  postgresql-extension
login hook
Postgres database extension to mimic a logon trigger
Stars: ✭ 29 (-25.64%)
Mutual labels:  postgresql-extension
Pgx
Build Postgres Extensions with Rust!
Stars: ✭ 903 (+2215.38%)
Mutual labels:  postgresql-extension
Plsh
PL/sh is a procedural language handler for PostgreSQL that allows you to write stored procedures in a shell of your choice.
Stars: ✭ 111 (+184.62%)
Mutual labels:  postgresql-extension
Pguri
uri type for PostgreSQL
Stars: ✭ 235 (+502.56%)
Mutual labels:  postgresql-extension
Pgaudit
PostgreSQL Audit Extension
Stars: ✭ 532 (+1264.1%)
Mutual labels:  postgresql-extension
aspnet-core-vuejs-template
ASP.NET Core / Vue.js SPA Template App
Stars: ✭ 75 (+92.31%)
Mutual labels:  postgressql
Decoderbufs
INACTIVE: A PostgreSQL logical decoder output plugin to deliver data as Protocol Buffers
Stars: ✭ 116 (+197.44%)
Mutual labels:  postgresql-extension
Pg similarity
set of functions and operators for executing similarity queries
Stars: ✭ 250 (+541.03%)
Mutual labels:  postgresql-extension
Pg partman
Partition management extension for PostgreSQL
Stars: ✭ 1,085 (+2682.05%)
Mutual labels:  postgresql-extension
Bgworker
Background Worker Processes for PostgreSQL written in Go
Stars: ✭ 77 (+97.44%)
Mutual labels:  postgresql-extension
Tds fdw
A PostgreSQL foreign data wrapper to connect to TDS databases (Sybase and Microsoft SQL Server)
Stars: ✭ 238 (+510.26%)
Mutual labels:  postgresql-extension
Pg acoustid
PostgreSQL extension for working with AcoustID fingerprints
Stars: ✭ 6 (-84.62%)
Mutual labels:  postgresql-extension
incubator-age-viewer
Graph database optimized for fast analysis and real-time data processing. It is provided as an extension to PostgreSQL.
Stars: ✭ 123 (+215.38%)
Mutual labels:  postgresql-extension
Pg auto failover
Postgres extension and service for automated failover and high-availability
Stars: ✭ 564 (+1346.15%)
Mutual labels:  postgresql-extension
Agensgraph Extension
A graph database extension for PostgreSQL
Stars: ✭ 170 (+335.9%)
Mutual labels:  postgresql-extension
icu ext
PostgreSQL extension (in C) to expose functionality from the ICU library
Stars: ✭ 23 (-41.03%)
Mutual labels:  postgresql-extension
mimeo
Extension for specialized, per-table replication between PostgreSQL instances
Stars: ✭ 74 (+89.74%)
Mutual labels:  postgresql-extension
Wasmer Postgres
💽🕸 Postgres library to run WebAssembly binaries.
Stars: ✭ 245 (+528.21%)
Mutual labels:  postgresql-extension

PL/Swift

PostgreSQL Swift3 Swift4 Swift5 macOS tuxOS

PL/Swift allows you to write custom SQL functions and types for the PostgreSQL database server in the Swift programming language.

Bringing Swift to the Backend of the Backend's Backend

A small tutorial can be found over here: PL/Swift - PostgreSQL Functions in Swift.

PL/Swift

Despite the name it is not (currently) a language extension like say PL/Python, which allows you to directly embed Swift code in SQL. Instead it provides the infrastructure to create PostgreSQL dynamically loadable objects.

This project/sourcedir contains the swift-pl tool, Xcode base configurations and module maps for the PostgreSQL server.

What is a PL/Swift Extension

A dynamically loadable PostgreSQL extension module consists of those files:

  • the ext.control file, specifies the name and version of the extension
  • the ext.sql file, hooks up the C function w/ PostgreSQL (i.e. does the CREATE FUNCTION)
  • the actual ext.so shared library

Using the PL/Swift package

NOTE: This requires a PL/Swift installation. W/o it, it will fail to built CPLSwift!

If you setup a new module from scratch, use:

swift pl init

for example:

mkdir base36 && cd base36
swift pl init

Otherwise setup your Package.swift to include PLSwift:

import PackageDescription

let package = Package(
  name: "MyTool",

  dependencies: [
    .Package(url: "[email protected]:PL-Swift/PLSwift.git", from: "0.5.0"),
  ]
)

Note: If you are using Swift older than 4.2, you need to use the swift3 branch (0.3.0 version tag).

Building a PL/Swift module

Simply invoke

swift pl build

This wraps Swift Package Manager to build your package and then produces a proper module which can be loaded into PostgreSQL.

To install the module into the local PostgreSQL, call:

swift pl install

Use/load the extension

That is very simple, just do a:

CREATE EXTENSION helloswift;

If you rebuild the extension and need to reload, you probably need to restart / reconnected psql and do a DROP EXTENSION xyz first.

Status

Consider this a demo. Though it should work just fine.

Plans:

  • can we make it a real language module? i.e. embed Swift code in the SQL and compile it on demand? Why not, might be a bit heavy though.

Links

Who

PL/Swift is brought to you by ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.


ApacheExpress

mod_swift

ZeeQL
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].