public static string GetPsqlExpression(Expression linqExpression, PsqlGeneratingQueryModelVisitor queryModelVisitor, ExpressionVisitorOptions options)
        {
            var visitor = new PsqlGeneratingExpressionVisitor(queryModelVisitor, options);

            visitor.Visit(linqExpression);
            return(visitor.GetPsqlExpression());
        }
        /// Creates an instance of the PsqlGenratingQueryModelVisitor to visit the QueryModel provided as an argument and to generate a corresponding PostgreSQL query.
        public static QueryCommand GeneratePsqlQuery(QueryModel queryModel, ITable table)
        {
            var visitor = new PsqlGeneratingQueryModelVisitor(table);

            visitor.VisitQueryModel(queryModel);
            return(visitor.GetPsqlCommand());
        }
        private PsqlGeneratingExpressionVisitor(PsqlGeneratingQueryModelVisitor queryModelVisitor, ExpressionVisitorOptions options = null)
        {
            _psqlExpressionBuilder = new StringBuilder();
            _queryModelVisitor     = queryModelVisitor;

            _visitorTriggeredByMemberVisitor = false;
            _readingConditionalStatement     = false;
            _renamingColumns = false;

            _table           = queryModelVisitor._table;
            _tableDefinition = _table.TableDefinition;
            _options         = options ?? new ExpressionVisitorOptions();
        }
 /// Creates an instance of the PsqlGeneratingExpressionVisitor based on provided PsqlGeneratingQueryModelVisitor instance to visit the LINQ expression provided as an argument and to generate a corresponding part of the PostgreSQL query.
 public static string GetPsqlExpression(Expression linqExpression, PsqlGeneratingQueryModelVisitor queryModelVisitor)
 {
     return(GetPsqlExpression(linqExpression, queryModelVisitor, null));
 }