mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-09-03 20:52:57 -05:00
Added support for editing of result sets from tables with OIDs in query tool.
This commit is contained in:
committed by
Akshay Joshi
parent
2ef3080d0e
commit
82d209946f
@@ -863,6 +863,7 @@ class QueryToolCommand(BaseCommand, FetchedRowTracker):
|
||||
self.is_updatable_resultset = False
|
||||
self.primary_keys = None
|
||||
self.pk_names = None
|
||||
self.table_has_oids = False
|
||||
|
||||
def get_sql(self, default_conn=None):
|
||||
return None
|
||||
@@ -873,13 +874,16 @@ class QueryToolCommand(BaseCommand, FetchedRowTracker):
|
||||
def get_primary_keys(self):
|
||||
return self.pk_names, self.primary_keys
|
||||
|
||||
def has_oids(self):
|
||||
return self.table_has_oids
|
||||
|
||||
def can_edit(self):
|
||||
return self.is_updatable_resultset
|
||||
|
||||
def can_filter(self):
|
||||
return False
|
||||
|
||||
def check_updatable_results_pkeys(self):
|
||||
def check_updatable_results_pkeys_oids(self):
|
||||
"""
|
||||
This function is used to check whether the last successful query
|
||||
produced updatable results and sets the necessary flags and
|
||||
@@ -895,8 +899,8 @@ class QueryToolCommand(BaseCommand, FetchedRowTracker):
|
||||
# Get the path to the sql templates
|
||||
sql_path = 'sqleditor/sql/#{0}#'.format(manager.version)
|
||||
|
||||
self.is_updatable_resultset, self.primary_keys, pk_names, table_oid = \
|
||||
is_query_resultset_updatable(conn, sql_path)
|
||||
self.is_updatable_resultset, self.table_has_oids, self.primary_keys, \
|
||||
pk_names, table_oid = is_query_resultset_updatable(conn, sql_path)
|
||||
|
||||
# Create pk_names attribute in the required format
|
||||
if pk_names is not None:
|
||||
|
||||
Reference in New Issue
Block a user