Giter Club home page Giter Club logo

hb-ddb's People

Contributors

adamdruppe avatar aldem avatar belka-ew avatar brendanmckenzie avatar denizzzka avatar jacob-carlborg avatar jaitd avatar jongiddy avatar luismarques avatar pinver avatar pszturmaj avatar s-ludwig avatar wilzbach avatar zhaopuming avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

boris-barboris

hb-ddb's Issues

Always send binary data for bind messages

                        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
                    }

PGConnection: executeQuery without PGCommand

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?

Handle parse errors

         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);
+			}

Check ConnectionPool

  • Does it make sense to release an already connected & authorized stream?
    A: No, it gets back to the connection pool
  • Test connection reuse

SSL support

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);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.