Esempio n. 1
0
        public NpgsqlMethodCallTranslatorProvider(
            [NotNull] RelationalMethodCallTranslatorProviderDependencies dependencies,
            [NotNull] IRelationalTypeMappingSource typeMappingSource,
            [NotNull] INpgsqlOptions npgsqlOptions)
            : base(dependencies)
        {
            var npgsqlSqlExpressionFactory = (NpgsqlSqlExpressionFactory)dependencies.SqlExpressionFactory;
            var npgsqlTypeMappingSource    = (NpgsqlTypeMappingSource)typeMappingSource;
            var jsonTranslator             = new NpgsqlJsonPocoTranslator(typeMappingSource, npgsqlSqlExpressionFactory);

            LTreeTranslator = new NpgsqlLTreeTranslator(typeMappingSource, npgsqlSqlExpressionFactory);

            AddTranslators(new IMethodCallTranslator[]
            {
                new NpgsqlArrayTranslator(typeMappingSource, npgsqlSqlExpressionFactory, jsonTranslator),
                new NpgsqlByteArrayMethodTranslator(npgsqlSqlExpressionFactory),
                new NpgsqlConvertTranslator(npgsqlSqlExpressionFactory),
                new NpgsqlDateTimeMethodTranslator(typeMappingSource, npgsqlSqlExpressionFactory),
                new NpgsqlFullTextSearchMethodTranslator(typeMappingSource, npgsqlSqlExpressionFactory),
                new NpgsqlFuzzyStringMatchMethodTranslator(npgsqlSqlExpressionFactory),
                new NpgsqlJsonDomTranslator(typeMappingSource, npgsqlSqlExpressionFactory),
                new NpgsqlJsonDbFunctionsTranslator(typeMappingSource, npgsqlSqlExpressionFactory),
                new NpgsqlLikeTranslator(npgsqlSqlExpressionFactory),
                LTreeTranslator,
                new NpgsqlMathTranslator(typeMappingSource, npgsqlSqlExpressionFactory),
                new NpgsqlNetworkTranslator(typeMappingSource, npgsqlSqlExpressionFactory),
                new NpgsqlNewGuidTranslator(npgsqlSqlExpressionFactory, npgsqlOptions.PostgresVersion),
                new NpgsqlObjectToStringTranslator(npgsqlSqlExpressionFactory),
                new NpgsqlRandomTranslator(npgsqlSqlExpressionFactory),
                new NpgsqlRangeTranslator(typeMappingSource, npgsqlSqlExpressionFactory),
                new NpgsqlRegexIsMatchTranslator(npgsqlSqlExpressionFactory),
                new NpgsqlStringMethodTranslator(npgsqlTypeMappingSource, npgsqlSqlExpressionFactory),
                new NpgsqlTrigramsMethodTranslator(npgsqlTypeMappingSource, npgsqlSqlExpressionFactory),
            });
        }
 public NpgsqlJsonPocoMemberTranslator(IRelationalTypeMappingSource typeMappingSource, NpgsqlSqlExpressionFactory sqlExpressionFactory, IModel model)
 {
     _typeMappingSource    = typeMappingSource;
     _sqlExpressionFactory = sqlExpressionFactory;
     _jsonPocoTranslator   = new NpgsqlJsonPocoTranslator(_typeMappingSource, _sqlExpressionFactory, model);
     _stringTypeMapping    = typeMappingSource.FindMapping(typeof(string));
 }
Esempio n. 3
0
 public NpgsqlArrayTranslator(
     [NotNull] IRelationalTypeMappingSource typeMappingSource,
     [NotNull] NpgsqlSqlExpressionFactory sqlExpressionFactory,
     [NotNull] NpgsqlJsonPocoTranslator jsonPocoTranslator)
 {
     _typeMappingSource    = typeMappingSource;
     _sqlExpressionFactory = sqlExpressionFactory;
     _jsonPocoTranslator   = jsonPocoTranslator;
 }
 public NpgsqlArrayTranslator(
     NpgsqlSqlExpressionFactory sqlExpressionFactory,
     NpgsqlJsonPocoTranslator jsonPocoTranslator,
     bool useRedshift)
 {
     _sqlExpressionFactory = sqlExpressionFactory;
     _jsonPocoTranslator   = jsonPocoTranslator;
     _useRedshift          = useRedshift;
 }
Esempio n. 5
0
        public NpgsqlMemberTranslatorProvider(
            [NotNull] RelationalMemberTranslatorProviderDependencies dependencies,
            IRelationalTypeMappingSource typeMappingSource)
            : base(dependencies)
        {
            var npgsqlSqlExpressionFactory = (NpgsqlSqlExpressionFactory)dependencies.SqlExpressionFactory;

            JsonPocoTranslator = new NpgsqlJsonPocoTranslator(npgsqlSqlExpressionFactory);

            AddTranslators(
                new IMemberTranslator[] {
                new NpgsqlStringMemberTranslator(npgsqlSqlExpressionFactory),
                new NpgsqlDateTimeMemberTranslator(npgsqlSqlExpressionFactory),
                new NpgsqlRangeTranslator(npgsqlSqlExpressionFactory),
                new NpgsqlJsonDomTranslator(npgsqlSqlExpressionFactory, typeMappingSource),
                JsonPocoTranslator
            });
        }
Esempio n. 6
0
        public NpgsqlMemberTranslatorProvider(
            [NotNull] RelationalMemberTranslatorProviderDependencies dependencies,
            [NotNull] IRelationalTypeMappingSource typeMappingSource)
            : base(dependencies)
        {
            var sqlExpressionFactory = (NpgsqlSqlExpressionFactory)dependencies.SqlExpressionFactory;

            JsonPocoTranslator = new NpgsqlJsonPocoTranslator(typeMappingSource, sqlExpressionFactory);

            AddTranslators(
                new IMemberTranslator[] {
                new NpgsqlArrayTranslator(typeMappingSource, sqlExpressionFactory, JsonPocoTranslator),
                new NpgsqlDateTimeMemberTranslator(sqlExpressionFactory),
                new NpgsqlJsonDomTranslator(typeMappingSource, sqlExpressionFactory),
                new NpgsqlLTreeTranslator(typeMappingSource, sqlExpressionFactory),
                JsonPocoTranslator,
                new NpgsqlRangeTranslator(typeMappingSource, sqlExpressionFactory),
                new NpgsqlStringMemberTranslator(sqlExpressionFactory),
                new NpgsqlTimeSpanMemberTranslator(sqlExpressionFactory)
            });
        }
Esempio n. 7
0
 public NpgsqlArrayMethodTranslator(NpgsqlSqlExpressionFactory sqlExpressionFactory, NpgsqlJsonPocoTranslator jsonPocoTranslator)
 {
     _sqlExpressionFactory = sqlExpressionFactory;
     _jsonPocoTranslator   = jsonPocoTranslator;
 }