mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added support for qtIdent, qtTypeIdent, qtLiteral for quoting the
inputs. In order to do the proper quoting around the identifier, different type, and literal, we introduced respective functions qtIdent, qtTypeIdent, qtLiteral in psycopg2 driver. Also, introduced them as the Jinja's custom filter for using it directly inside the templates. Also, created an utility - generate_keywords.py in order to generate keyword lists from the latest PostgreSQL installation.
This commit is contained in:
@@ -104,6 +104,19 @@ class ServerModule(sg.ServerGroupPluginModule):
|
||||
|
||||
return scripts
|
||||
|
||||
def register(self, app, options, first_registration=False):
|
||||
"""
|
||||
Override the default register function to automagically register
|
||||
sub-modules at once.
|
||||
"""
|
||||
if first_registration:
|
||||
from pgadmin.utils.driver import get_driver
|
||||
driver = get_driver(PG_DEFAULT_DRIVER, app)
|
||||
app.jinja_env.filters['qtLiteral'] = driver.qtLiteral
|
||||
app.jinja_env.filters['qtIdent'] = driver.qtIdent
|
||||
app.jinja_env.filters['qtTypeIdent'] = driver.qtTypeIdent
|
||||
|
||||
super(ServerModule, self).register(app, options, first_registration)
|
||||
|
||||
class ServerMenuItem(MenuItem):
|
||||
def __init__(self, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user