Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jdonaldson/postgrehx
An implementation of the postgres wire protocol in Haxe
https://github.com/jdonaldson/postgrehx
Last synced: about 1 month ago
JSON representation
An implementation of the postgres wire protocol in Haxe
- Host: GitHub
- URL: https://github.com/jdonaldson/postgrehx
- Owner: jdonaldson
- Created: 2013-09-03T04:57:32.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-02-09T22:13:26.000Z (almost 8 years ago)
- Last Synced: 2023-03-11T08:12:57.648Z (almost 2 years ago)
- Language: Haxe
- Size: 79.1 KB
- Stars: 15
- Watchers: 4
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Postgrehx
Postgrehx is a pure Haxe implementation of the [Postgres wire
protocol](http://www.postgresql.org/docs/9.2/static/protocol.html).This library is in an early alpha state, but is passing some basic tests.
[![Build Status](https://travis-ci.org/jdonaldson/postgrehx.png)](https://travis-ci.org/jdonaldson/postgrehx)
Here's the current TODO:
1. automatic decoding of types other than numbers, booleans, strings,
and timestamps.
2. fill out the rest of the haxe sys.db.Connection interface
3. properly handle the async message flow from postgresDONE:
1. MD5 and basic authentication (thanks Juraj!)## Usage
```haxe
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;
}
}
```## Running Tests
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.## Acknowledgments
Thanks to [theRemix](https://github.com/theremix) and
[back2Dos](https://github.com/back2dos) for contributing test cases
and fixes.