Exemple #1
0
        internal Connection(Builder builder)
        {
            dbname = builder.dbname;
            if (builder.authKey.IsNotNullOrEmpty() && builder.user.IsNotNullOrEmpty())
            {
                throw new ReqlDriverError("Either `authKey` or `user` can be used, but not both.");
            }

            var user     = builder.user ?? "admin";
            var password = builder.password ?? builder.authKey ?? "";

            this.handshake = new Handshake(user, password);

            this.Hostname   = builder.hostname ?? "localhost";
            this.Port       = builder.port ?? RethinkDBConstants.DefaultPort;
            connectTimeout  = builder.timeout;
            this.sslContext = builder.sslContext;
        }