Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Get tests passing on Julia v0.4-v0.6 #53

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ addons:
postgresql: "9.3"
julia:
- 0.4
- nightly
- 0.5
- 0.6
notifications:
email: false
before_script:
- psql -c 'create database julia_test;' -U postgres
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.clone(pwd()); Pkg.clone("https://github.com/JuliaDB/DBI.jl")'
- julia -e 'Pkg.clone(pwd()); Pkg.clone("https://github.com/JuliaDB/DBI.jl"); Pkg.build("PostgreSQL");'
- julia -e 'using PostgreSQL; @assert isdefined(:PostgreSQL); @assert typeof(PostgreSQL) === Module'
- julia -e 'Pkg.test("PostgreSQL"; coverage=true)'
after_success:
Expand Down
15 changes: 15 additions & 0 deletions TestingNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Testing Postgres Locally on OSX #

## Installing Postgres with correct Users ##

* `brew install postgresql`

* `pg_ctl start -D /usr/local/var/postgres`

* `createuser -s postgres`

* `psql -c 'create database julia_test;' -U postgres`

## Testing on v0.4 ##

In order to test on this version of Julia, `BaseTestNext` is required.
1 change: 1 addition & 0 deletions deps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/deps.jl
17 changes: 9 additions & 8 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
using BinDeps
using Compat

@BinDeps.setup

libpq = library_dependency("libpq", aliases=["libpq5"])
const libpq = library_dependency("libpq", aliases=["libpq5"])

major, minor = (9,4)
branch = "REL$(major)_$(minor)_STABLE"
const major, minor = (9,4)
const branch = "REL$(major)_$(minor)_STABLE"

postgresql_srcurl = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=snapshot;h=refs/heads/$branch;sf=tgz"
postgresql_giturl = "https://github.com/postgres/postgres" # GitHub mirror
const postgresql_srcurl = "http://git.postgresql.org/gitweb/?p=postgresql.git;a=snapshot;h=refs/heads/$branch;sf=tgz"
const postgresql_giturl = "https://github.com/postgres/postgres" # GitHub mirror

postgresql_srcdir = joinpath(BinDeps.srcdir(libpq), "postgresql")
postgresql_usrdir = BinDeps.usrdir(libpq)
const postgresql_srcdir = joinpath(BinDeps.srcdir(libpq), "postgresql")
const postgresql_usrdir = BinDeps.usrdir(libpq)

provides(AptGet, "libpq5", libpq)
provides(Yum, "libpq5", libpq)
provides(Yum, "postgresql-libs", libpq)
provides(Pacman, "postgresql-libs", libpq)

@osx_only begin
@static if is_apple()
using Homebrew
provides(Homebrew.HB, "postgresql", libpq, os=:Darwin)
end
Expand Down
94 changes: 94 additions & 0 deletions deps/usr/include/libpq-events.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*-------------------------------------------------------------------------
*
* libpq-events.h
* This file contains definitions that are useful to applications
* that invoke the libpq "events" API, but are not interesting to
* ordinary users of libpq.
*
* Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/interfaces/libpq/libpq-events.h
*
*-------------------------------------------------------------------------
*/

#ifndef LIBPQ_EVENTS_H
#define LIBPQ_EVENTS_H

#include "libpq-fe.h"

#ifdef __cplusplus
extern "C"
{
#endif

/* Callback Event Ids */
typedef enum
{
PGEVT_REGISTER,
PGEVT_CONNRESET,
PGEVT_CONNDESTROY,
PGEVT_RESULTCREATE,
PGEVT_RESULTCOPY,
PGEVT_RESULTDESTROY
} PGEventId;

typedef struct
{
PGconn *conn;
} PGEventRegister;

typedef struct
{
PGconn *conn;
} PGEventConnReset;

typedef struct
{
PGconn *conn;
} PGEventConnDestroy;

typedef struct
{
PGconn *conn;
PGresult *result;
} PGEventResultCreate;

typedef struct
{
const PGresult *src;
PGresult *dest;
} PGEventResultCopy;

typedef struct
{
PGresult *result;
} PGEventResultDestroy;

typedef int (*PGEventProc) (PGEventId evtId, void *evtInfo, void *passThrough);

/* Registers an event proc with the given PGconn. */
extern int PQregisterEventProc(PGconn *conn, PGEventProc proc,
const char *name, void *passThrough);

/* Sets the PGconn instance data for the provided proc to data. */
extern int PQsetInstanceData(PGconn *conn, PGEventProc proc, void *data);

/* Gets the PGconn instance data for the provided proc. */
extern void *PQinstanceData(const PGconn *conn, PGEventProc proc);

/* Sets the PGresult instance data for the provided proc to data. */
extern int PQresultSetInstanceData(PGresult *result, PGEventProc proc, void *data);

/* Gets the PGresult instance data for the provided proc. */
extern void *PQresultInstanceData(const PGresult *result, PGEventProc proc);

/* Fires RESULTCREATE events for an application-created PGresult. */
extern int PQfireResultCreateEvents(PGconn *conn, PGresult *res);

#ifdef __cplusplus
}
#endif

#endif /* LIBPQ_EVENTS_H */
Loading