Ejemplo n.º 1
0
        public PostgresQueryManager(
            ConnectionInfo connectionInfo,
            ILogFactory logFactory,
            Func<NpgsqlConnection, NpgsqlTransaction, ILogFactory, IPostgresDatabaseQuery> queryFactory)
        {
            Contract.Requires(connectionInfo != null);
            Contract.Requires(connectionInfo.ConnectionString != null);
            Contract.Requires(logFactory != null);
            Contract.Requires(queryFactory != null);

            this.ConnectionInfo = connectionInfo;
            this.LogFactory = logFactory;
            this.QueryFactory = queryFactory;
        }
Ejemplo n.º 2
0
        public PostgresVersionInfo(ConnectionInfo connectionInfo)
        {
            Contract.Requires(connectionInfo != null);
            Contract.Requires(connectionInfo.ConnectionString != null);

            using (var connection = connectionInfo.GetConnection())
            {
                connection.Open();
                var version = connection.PostgreSqlVersion;
                Major = version.Major;
                Minor = version.Minor;
                connection.Close();
            }
        }