Esempio n. 1
0
        public Term GenerateTerm(IDatumConverterFactory datumConverterFactory)
        {
            var tableTerm = new Term()
            {
                type = Term.TermType.TABLE_LIST,
            };

            tableTerm.args.Add(dbTerm.GenerateTerm(datumConverterFactory));
            return(tableTerm);
        }
Esempio n. 2
0
        public Term GenerateTerm(IQueryConverter queryConverter)
        {
            var tableTerm = new Term()
            {
                type = Term.TermType.TABLE_LIST,
            };

            tableTerm.args.Add(dbTerm.GenerateTerm(queryConverter));
            return(tableTerm);
        }
Esempio n. 3
0
        public Term GenerateTerm(IDatumConverterFactory datumConverterFactory)
        {
            var tableTerm = new Term()
            {
                type = Term.TermType.TABLE_DROP,
            };

            tableTerm.args.Add(dbTerm.GenerateTerm(datumConverterFactory));
            tableTerm.args.Add(
                new Term()
            {
                type  = Term.TermType.DATUM,
                datum = new Datum()
                {
                    type  = Datum.DatumType.R_STR,
                    r_str = table,
                }
            }
                );
            return(tableTerm);
        }
Esempio n. 4
0
        public Term GenerateTerm(IQueryConverter queryConverter)
        {
            var tableTerm = new Term()
            {
                type = Term.TermType.TABLE,
            };

            tableTerm.args.Add(dbTerm.GenerateTerm(queryConverter));
            tableTerm.args.Add(
                new Term()
            {
                type  = Term.TermType.DATUM,
                datum = new Datum()
                {
                    type  = Datum.DatumType.R_STR,
                    r_str = table,
                }
            }
                );
            if (useOutdated)
            {
                tableTerm.optargs.Add(new Term.AssocPair()
                {
                    key = "use_outdated",
                    val = new Term()
                    {
                        type  = Term.TermType.DATUM,
                        datum = new Datum()
                        {
                            type   = Datum.DatumType.R_BOOL,
                            r_bool = useOutdated,
                        }
                    }
                });
            }
            return(tableTerm);
        }
        public Term GenerateTerm(IQueryConverter queryConverter)
        {
            var tableTerm = new Term()
            {
                type = Term.TermType.TABLE_CREATE,
            };

            tableTerm.args.Add(dbTerm.GenerateTerm(queryConverter));
            tableTerm.args.Add(
                new Term()
            {
                type  = Term.TermType.DATUM,
                datum = new Datum()
                {
                    type  = Datum.DatumType.R_STR,
                    r_str = table,
                }
            }
                );

            if (!String.IsNullOrEmpty(datacenter))
            {
                tableTerm.optargs.Add(new Term.AssocPair()
                {
                    key = "datacenter",
                    val = new Term()
                    {
                        type  = Term.TermType.DATUM,
                        datum = new Datum()
                        {
                            type  = Datum.DatumType.R_STR,
                            r_str = datacenter,
                        }
                    }
                });
            }

            if (!String.IsNullOrEmpty(primaryKey))
            {
                tableTerm.optargs.Add(new Term.AssocPair()
                {
                    key = "primary_key",
                    val = new Term()
                    {
                        type  = Term.TermType.DATUM,
                        datum = new Datum()
                        {
                            type  = Datum.DatumType.R_STR,
                            r_str = primaryKey,
                        }
                    }
                });
            }

            if (cacheSize.HasValue)
            {
                tableTerm.optargs.Add(new Term.AssocPair()
                {
                    key = "cache_size",
                    val = new Term()
                    {
                        type  = Term.TermType.DATUM,
                        datum = new Datum()
                        {
                            type  = Datum.DatumType.R_NUM,
                            r_num = cacheSize.Value,
                        }
                    }
                });
            }

            return(tableTerm);
        }