teamhackback / hb-ddb Goto Github PK
View Code? Open in Web Editor NEWThis project forked from pszturmaj/ddb
Vibe.d Async native D Postgres client
Home Page: https://teamhackback.github.io/hb-ddb/docs/ddb/pg.html
This project forked from pszturmaj/ddb
Vibe.d Async native D Postgres client
Home Page: https://teamhackback.github.io/hb-ddb/docs/ddb/pg.html
Fix the holes in @trusted
.
case BOOLEAN:
case TIMESTAMP:
case INET:
case NUMERIC:
case JSONB:
case INTERVAL:
case VARCHAR:
case TEXT:
stream.write(cast(short) 0); // text format
break;
default:
stream.write(cast(short) 1); // binary format
}
Should be the same as in PGConnection, but here query is a variable an function already
It's currently split into multiple bits
-> proper encapsulation
and maybe even Async ones?
use e.g. FreeListRef
for scoped allocation of classes
interval is converted to Duration, which does not support months
Currently executeQuery
(or executeRow
, executeNonQuery
or executeScalar) create a temporary
PGCommand`:
PGResultSet!Specs executeQuery(Specs...)(string query)
{
scope cmd = FreeListRef!PGCommand(this, query);
return cmd.executeQuery!Specs();
}
which itself calls:
PGResultSet!Specs executeQuery(Specs...)()
{
checkPrepared(true);
checkBound();
return conn.executeQuery!Specs(preparedName, _fields);
}
Maybe it might make sense to avoid creating a prepared statement at all?
genLabels
adds a huge overhead to the compile-time.
Plain text mode is used by simple queries, but not very well supported.
Deprecated as ResultSet is now ref-counted
void sendParseMessage(string statementName, string query, int[] oids)
{
int len = cast(int)(4 + statementName.length + 1 + query.length + 1 + 2 + oids.length * 4);
- + bool failed;
- stream.write('P'); + try stream.write('P');
+ catch (Exception e) {
+ failed = true;
+ }
+ if (failed) {
+ close();
+ throw new Exception("Error in parse: " ~ statementName ~ " query: " ~ query);
+ }
this(UDSConnection socket)
See also:
Shortcut to create new commands. May use FreeListRef
Something similar like:
auto conn = connectTCP(m_options.address, m_options.port);
auto sslctx = new SSLContext(m_options.cert, m_options.key);
auto stream = new SSLStream(conn, sslctx, SSLStreamState.connecting);
BEGIN
...
COMMIT
See also: https://github.com/dvigal/ddb/blob/f283ebb3fbb8d3c811a39721cff282587154812f/source/ddb/transaction.d
@atomic
UDA?rollbackTo
savepoint
(create new transaction?)txid
listen, trigger
https://github.com/rejectedsoftware/vibe.d/blob/master/http/vibe/http/common.d#L472
createChunkedOutputStream(stream)
See also: pszturmaj/ddb@master...etcimon:master
At least trigger an assert
warning
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.