Пример #1
0
 private static RValueSQL createValue(int sqlType, RawVal rawVal)
 {
     return(new RValueSQL()
     {
         SqlType = sqlType, Val = rawVal
     });
 }
Пример #2
0
        public static RValueSQL ToRValueSQL(this DateTime value)
        {
            RawVal rawVal = new RawVal()
            {
                Bigint_val = value.ToEpochMs()
            };

            return(createValue(SQLTypes.TIMESTAMP, rawVal));
        }
Пример #3
0
        public static RValueSQL ToRValueSQL(this double value)
        {
            RawVal rawVal = new RawVal()
            {
                Double_val = value
            };

            return(createValue(SQLTypes.DOUBLE, rawVal));
        }
Пример #4
0
        public static RValueSQL ToRValueSQL(this short value)
        {
            RawVal rawVal = new RawVal()
            {
                Smallint_val = value
            };

            return(createValue(SQLTypes.SMALLINT, rawVal));
        }
Пример #5
0
        public static RValueSQL ToRValueSQL(this int value)
        {
            RawVal rawVal = new RawVal()
            {
                Integer_val = value
            };

            return(createValue(SQLTypes.INTEGER, rawVal));
        }
Пример #6
0
        public static RValueSQL ToRValueSQL(this bool value)
        {
            RawVal rawVal = new RawVal()
            {
                Bool_val = value
            };

            return(createValue(SQLTypes.BOOLEAN, rawVal));
        }
Пример #7
0
        public static RValueSQL ToRValueSQL(this long value)
        {
            RawVal rawVal = new RawVal()
            {
                Bigint_val = value
            };

            return(createValue(SQLTypes.BIGINT, rawVal));
        }
Пример #8
0
        public static RValueSQL ToRValueSQL(this string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                return(ToRValueSQLNull());
            }

            RawVal rawVal = new RawVal()
            {
                String_val = value
            };

            return(createValue(SQLTypes.VARCHAR, rawVal));
        }
Пример #9
0
        private static RValueSQL createArray(int sqlType, List <RawVal> values)
        {
            ArrayVal arrayVal = new ArrayVal()
            {
                SqlType = sqlType, Elements = values
            };

            RawVal rawVal = new RawVal()
            {
                Array_val = arrayVal
            };

            return(createValue(SQLTypes.ARRAY, rawVal));
        }