How to use the edgedb.server.pgsql.common.quote_ident function in edgedb

To help you get started, we’ve selected a few edgedb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github edgedb / edgedb / edgedb / server / pgsql / codegen.py View on Github external
def visit_FuncAliasNode(self, node):
        self.write(common.quote_ident(node.alias))
        if node.elements:
            self.write(' (')
            count = len(node.elements)
            for i, expr in enumerate(node.elements):
                self.visit(expr)
                if i != count - 1:
                    self.write(', ')
            self.write(')')
github edgedb / edgedb / edgedb / server / pgsql / codegen.py View on Github external
def visit_SelectExprNode(self, node):
        self.visit(node.expr)
        if node.alias:
            self.write(' AS ' + common.quote_ident(node.alias))
github edgedb / edgedb / edgedb / server / pgsql / codegen.py View on Github external
def visit_CTENode(self, node):
        if isinstance(node.alias, str):
            self.write(common.quote_ident(node.alias))
        else:
            self.write(common.quote_ident(node.alias.alias))
github edgedb / edgedb / edgedb / server / pgsql / dbops / types.py View on Github external
async def code(self, context):
        code = super().prefix_code(context)
        code += ' RENAME TO %s ' % common.quote_ident(self.new_name)
        return code
github edgedb / edgedb / edgedb / server / pgsql / dbops / constraints.py View on Github external
def constraint_name(self, quote=True):
        if quote and self._constraint_name:
            return common.quote_ident(self._constraint_name)
        else:
            return self._constraint_name
github edgedb / edgedb / edgedb / server / pgsql / dbops / schemas.py View on Github external
async def code(self, context):
        return 'CREATE SCHEMA %s' % common.quote_ident(self.name)
github edgedb / edgedb / edgedb / server / pgsql / dbops / schemas.py View on Github external
async def code(self, context):
        return '''ALTER SCHEMA {} RENAME TO {}'''.format(
            common.quote_ident(self.name),
            common.quote_ident(self.new_name)), []
github edgedb / edgedb / edgedb / server / pgsql / codegen.py View on Github external
def visit_TableQueryNode(self, node):
        self.write('(TABLE ')
        if node.schema:
            self.write(common.qname(node.schema, node.name))
        else:
            self.write(common.quote_ident(node.name))
        self.write(')')