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

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

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

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

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

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

            return(createValue(SQLTypes.BIGINT, rawVal));
        }
Exemple #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));
        }
Exemple #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));
        }