diff --git a/src/pg/decoder.cr b/src/pg/decoder.cr index 63a06ccb..63bcc189 100644 --- a/src/pg/decoder.cr +++ b/src/pg/decoder.cr @@ -1,5 +1,9 @@ require "json" +lib LibC + fun atoi(str : UInt8*) : Int32 +end + module PG alias PGValue = String | Nil | Bool | Int32 | Float32 | Float64 | Time | JSON::Type diff --git a/src/pg/libpq.cr b/src/pg/libpq.cr index 46ea8424..d17b88bd 100644 --- a/src/pg/libpq.cr +++ b/src/pg/libpq.cr @@ -6,7 +6,7 @@ module PG alias Int = Int32 alias Oid = Int32 - struct PGconn end + alias PGconn = Void enum ConnStatusType CONNECTION_OK, CONNECTION_BAD, CONNECTION_STARTED, CONNECTION_MADE, CONNECTION_AWAITING_RESPONSE, CONNECTION_AUTH_OK, CONNECTION_SETENV, @@ -28,7 +28,7 @@ module PG result_format : Int ) : PGresult* - struct PGresult end + alias PGresult = Void enum ExecStatusType PGRES_EMPTY_QUERY, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PGRES_COPY_OUT, PGRES_COPY_IN, PGRES_BAD_RESPONSE, PGRES_NONFATAL_ERROR, PGRES_FATAL_ERROR,