Skip to content

lekerning/PostgreSQL

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostgreSQL

Swift 2.2 Platforms Linux License MIT Slack Status

PostgreSQL adapter for Swift 2.2.

Usage

let connection = Connection("postgresql://localhost/movies")
do {
	try connection.open()
	try connection.execute("INSERT INTO films (name) VALUES($1)", parameters: "Shawshank redemption")
	let result = try connection.execute(
	"SELECT * FROM films where name = $1", parameters: "Shawshank redemption")
	for row in result {
        print(row["name"]?.string)
    }
} catch {
	print(error)
}

Installation

  • Install libpq-dev

Linux

$ (sudo) apt-get install libpq-dev

OSX

$ brew install postgresql
  • Add PostgreSQL to your Package.swift
import PackageDescription

let package = Package(
	dependencies: [
		.Package(url: "https://github.com/Zewo/PostgreSQL.git", majorVersion: 0, minor: 2)
	]
)

Community

Slack

Join us on Slack.

License

PostgreSQL is released under the MIT license. See LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 100.0%