public void AddMemberEntry(KDPgValueType memberType)
        {
            fieldsCount += 1;

            Entries.Add(new Entry {
                MemberPgType = memberType,
            });
        }
예제 #2
0
        public static TypedExpression CastJsonToType(TypedExpression value, KDPgValueType pgType)
        {
            RawQuery rq = new RawQuery();

            rq.Append("(");
            rq.AppendSurround(value.RawQuery);
            rq.Append("#>>'{}')::");
            rq.Append(pgType.PostgresTypeName);
            return(new TypedExpression(rq, pgType));
        }
예제 #3
0
        public KdPgColumnDescriptor(string name, KDPgColumnFlagsEnum flags, KDPgValueType type, PropertyInfo propertyInfo, KdPgTableDescriptor table)
        {
            Name         = name;
            Flags        = flags;
            Type         = type;
            PropertyInfo = propertyInfo;
            Table        = table;

            var rq = new RawQuery();

            rq.AppendColumn(this, new RawQuery.TableNamePlaceholder(table, table.Name));
            TypedExpression = new TypedExpression(rq, type);
        }
예제 #4
0
 public RawQuery AppendWithCast(RawQuery query, KDPgValueType pgType)
 {
     return(AppendWithCast(query, pgType.PostgresTypeName));
 }
예제 #5
0
 // ReSharper disable ParameterOnlyUsedForPreconditionCheck.Local
 private static void AssertPath <TModel>(PathInfo pi, string columnName, string query, KDPgValueType type)
 {
     Assert.Equal(type, pi.Expression.Type);
     Assert.Equal(query, pi.Expression.RawQuery.ToString());
     Assert.Equal(ModelsRegistry.GetTable <TModel>().Columns.Find(x => x.Name == columnName), pi.Column);
 }
예제 #6
0
 public SingleValueSelectResultProcessor(KDPgValueType type)
 {
     _type = type;
 }
예제 #7
0
        private static TypedExpression BinaryOperator(string op, TypedExpression left, TypedExpression right, KDPgValueType outType)
        {
            RawQuery rq = new RawQuery();

            rq.AppendSurround(left.RawQuery);
            rq.Append($" {op} ");
            rq.AppendSurround(right.RawQuery);

            return(new TypedExpression(rq, outType));
        }
예제 #8
0
 public TypedExpression(RawQuery rawQuery, KDPgValueType type)
 {
     RawQuery = rawQuery;
     Type     = type;
 }
예제 #9
0
 public PgValue(object value, KDPgValueType type)
 {
     Value = value;
     Type  = type;
 }