예제 #1
0
        /// <summary>
        /// Execute SQL commands and return as data reader
        /// </summary>
        public Task <IBsonDataReader> ExecuteAsync(string command, BsonDocument parameters = null)
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var tokenizer = new Tokenizer(command);
            var sql       = new SqlParser(_engine, tokenizer, parameters);

            return(sql.Execute());
        }
예제 #2
0
        /// <summary>
        /// Execute SQL commands and return as data reader.
        /// </summary>
        public IBsonDataReader Execute(TextReader commandReader, BsonDocument parameters = null)
        {
            if (commandReader == null)
            {
                throw new ArgumentNullException(nameof(commandReader));
            }

            var tokenizer = new Tokenizer(commandReader);
            var sql       = new SqlParser(_engine, tokenizer, parameters);
            var reader    = sql.Execute();

            return(reader);
        }