Esempio n. 1
0
 public PgSQLConnectionImpl(
     PgSQLConnectionVendorFunctionality vendorFunctionality,
     PostgreSQLProtocol functionality,
     DatabaseMetadata metaData
     )
     : base(vendorFunctionality, functionality, metaData)
 {
 }
Esempio n. 2
0
File: Meta.cs Progetto: stazz/CBAM
 public PgSQLDatabaseMetaData(
     PgSQLConnectionVendorFunctionality vendorFunctionality,
     PostgreSQLProtocol connectionFunctionality
     ) : base(
         vendorFunctionality,
         connectionFunctionality,
         SchemaSearchSQLFactory,
         TableSearchSQLFactory,
         ColumnSearchSQLFactory,
         PrimaryKeySearchSQLFactory,
         ForeignKeySearchSQLFactory
         )
 {
 }
Esempio n. 3
0
        public PostgreSQLProtocol(
            PgSQLConnectionVendorFunctionality vendorFunctionality,
            Boolean disableBinaryProtocolSend,
            Boolean disableBinaryProtocolReceive,
            BackendABIHelper messageIOArgs,
            Stream stream,
            ResizableArray <Byte> buffer,
            Socket socket,
            IDictionary <String, String> serverParameters,
            TransactionStatus status,
            Int32 backendPID
            )
        {
            this.DisableBinaryProtocolSend    = disableBinaryProtocolSend;
            this.DisableBinaryProtocolReceive = disableBinaryProtocolReceive;
            this.MessageIOArgs      = ArgumentValidator.ValidateNotNull(nameof(messageIOArgs), messageIOArgs);
            this.Stream             = ArgumentValidator.ValidateNotNull(nameof(stream), stream);
            this.Socket             = ArgumentValidator.ValidateNotNull(nameof(socket), socket);
            this.Buffer             = buffer ?? new ResizableArray <Byte>(8, exponentialResize: true);
            this.DataRowColumnSizes = new ResizableArray <ResettableTransformable <Int32?, Int32> >(exponentialResize: false);
            this._serverParameters  = ArgumentValidator.ValidateNotNull(nameof(serverParameters), serverParameters);
            this.TypeRegistry       = new TypeRegistryImpl(vendorFunctionality, this);

            if (serverParameters.TryGetValue("server_version", out var serverVersionString))
            {
                // Parse server version
                var i       = 0;
                var version = serverVersionString.Trim();
                while (i < version.Length && (Char.IsDigit(version[i]) || version[i] == '.'))
                {
                    ++i;
                }
                this._serverVersion = new Version(version.Substring(0, i));
            }

            // Min supported version is 8.4.
            var serverVersion = this._serverVersion;

            if (serverVersion != null && (serverVersion.Major < 8 || (serverVersion.Major == 8 && serverVersion.Minor < 4)))
            {
                throw new PgSQLException("Unsupported server version: " + serverVersion + ".");
            }
            this.LastSeenTransactionStatus = status;
            this.BackendProcessID          = backendPID;
        }