Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JuliaDatabases/PostgreSQL.jl
DEPRECATED: use LibPQ.jl instead
https://github.com/JuliaDatabases/PostgreSQL.jl
Last synced: 3 months ago
JSON representation
DEPRECATED: use LibPQ.jl instead
- Host: GitHub
- URL: https://github.com/JuliaDatabases/PostgreSQL.jl
- Owner: JuliaDatabases
- License: other
- Created: 2014-01-02T20:49:52.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-10-30T12:51:24.000Z (about 4 years ago)
- Last Synced: 2024-06-11T19:43:56.223Z (5 months ago)
- Language: Julia
- Homepage: https://github.com/invenia/LibPQ.jl
- Size: 115 KB
- Stars: 60
- Watchers: 10
- Forks: 39
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# PostgreSQL.jl
[![Build Status](https://travis-ci.org/JuliaDB/PostgreSQL.jl.svg)](https://travis-ci.org/JuliaDB/PostgreSQL.jl) [![Coverage Status](https://img.shields.io/coveralls/JuliaDB/PostgreSQL.jl.svg)](https://coveralls.io/r/JuliaDB/PostgreSQL.jl) [![codecov.io](http://codecov.io/github/JuliaDB/PostgreSQL.jl/coverage.svg)](http://codecov.io/github/JuliaDB/PostgreSQL.jl)
An interface to PostgreSQL from Julia. Uses libpq (the C PostgreSQL API) and obeys the [DBI.jl protocol](https://github.com/JuliaDatabases/DBI.jl).
## Maintenance Notice
I can no longer spend work time on this so this project is in maintenance mode (accepting PRs and attempting to resolve issues). New code on the `dbapi` branch (https://github.com/JuliaDatabases/DBAPI.jl) represents the most recent work, which I will continue if I am in a position to do so again.
## Usage
```julia
using DBI
using PostgreSQLconn = connect(Postgres, "localhost", "username", "password", "dbname", 5432)
stmt = prepare(conn, "SELECT 1::bigint, 2.0::double precision, 'foo'::character varying, " *
"'foo'::character(10);")
result = execute(stmt)
for row in result
# code
endfinish(stmt)
disconnect(conn)
```### Block Syntax
```julia
using DBI
using PostgreSQLconnect(Postgres, "localhost", "username", "password", "dbname", 5432) do conn
#code
end
```## Requirements
* [DBI.jl](https://github.com/JuliaDatabases/DBI.jl)
* [DataFrames.jl](https://github.com/JuliaStats/DataFrames.jl) >= v0.5.7
* [DataArrays.jl](https://github.com/JuliaStats/DataArrays.jl) >= v0.1.2
* libpq shared library (comes with a standard PostgreSQL client installation)
* Julia 0.4Tests require a local PostgreSQL server with a postgres user/database (installed by default with PostgreSQL server installations) with trusted authentication from localhost.
## Systems
* Tested on Funtoo Linux and Windows 8
* Should work on other systems provided libpq is avaiable (please file an issue if this is not the case)## TODO (soon)
* Implement more default PostgreSQL type handling
* Test type handling overrides
* More comprehensive error handling and tests
* Support for COPY## TODO (not soon)
* Asynchronous connection support
* Asynchronous Julia for handling asynchronous connections
* Testing and compatibility with multiple versions of PostgreSQL and libpq