Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature-Request: Implementing DatabaseMetaData.getPrimaryKeys() #22408

Open
prrvchr opened this issue Jun 17, 2024 · 1 comment
Open

Feature-Request: Implementing DatabaseMetaData.getPrimaryKeys() #22408

prrvchr opened this issue Jun 17, 2024 · 1 comment

Comments

@prrvchr
Copy link
Member

prrvchr commented Jun 17, 2024

Hi all,

It's good, I manage to make the ResultSet coming from Trino editable by SQL commands generated when calling the methods allowing positioned updates on the ResultSet.

In order to work around issue #22306 I obtain the name of the catalog, the schema and the table of the ResultSet columns using the DatabaseMetaData.getColumns() method.

But since Trino does not support multiple predicates in SQL commands (ie: no AND in WHERE clauses), it is imperative for me to know the name of the primary key in order to be able to make table updatable in LibreOffice Base without knowing the structure of the edited tables.

This seems possible to me, only if I have access to the DatabaseMetaData.getPrimaryKeys() method, and which currently provides no data.

Would it be possible to have this method implemented?

@prrvchr prrvchr changed the title Implementing DatabaseMetaData.getPrimaryKeys() Feature-Request: Implementing DatabaseMetaData.getPrimaryKeys() Jun 18, 2024
@prrvchr
Copy link
Member Author

prrvchr commented Jun 19, 2024

Well, jdbcDriverOOo version 1.4.0 finally manages to edit the tables and Base queries coming from the Trino driver.

The implementation is not optimal because I am obliged to find the primary key of each ResultSet and consider that the first column not containing a duplicate is the primary key. This is not necessarily true and can therefore pose problems.

I think if we want something more robust then we would need access to the DatabaseMetaData.getPrimaryKeys() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant