Postgrehx is a pure Haxe implementation of the Postgres wire protocol.
This library is in an early alpha state, but is passing some basic tests.
Here's the current TODO:
DONE:
class Test {
static function main() {
var con = sys.db.Postgres.connect({
host : "localhost",
user : "jdonaldson",
pass : "jdonaldson",
database : "scratch"
});
trace(con.dbName() + " is the value for con.dbName()");
// con.request('SELECT NOW() AS "theTime"');
var res = con.request("
SELECT table_schema,table_name
FROM information_schema.tables
ORDER BY table_schema,table_name;
");
for (r in res) trace(r);
con.close();
return;
}
}
If you want to run the tests, execute the tools/create_db.sh bash script that contains the database, pass, and test user for the tests. To get rid of it, run the tools/destroy_db.sh script.
Postgrehx should work with most modern versions of PGSQL (version 8 or later). The tests are intended to run against version 9.3 or later, as they test the latest json indexing methods.
Thanks to theRemix and back2Dos for contributing test cases and fixes.