You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Riccardo Tommasini <ri...@polimi.it> on 2016/12/14 15:54:50 UTC

Accessing database metadata

Hi all,

I am trying to access db metadata through calcite. Playing around with the sqline interface and checking the code, I understood that calcite accesses those some metadata using the dedicate jdbc driver. However, some of them are non
available yet.

Is there a way to access primary keys for a table for instance?

thanks in advance!

Riccardo Tommasini
Master Degree Computer Science
PhD Student at Politecnico di Milano (Italy)
streamreasoning.org<http://streamreasoning.org/>

Submitted from an iPhone, I apologise for typos.

Re: Accessing database metadata

Posted by Riccardo Tommasini <ri...@polimi.it>.
Hi Julian,
thanks for the quick answer.

I will do it.



Riccardo Tommasini
Master Degree Computer Science
PhD Student at Politecnico di Milano (Italy)
streamreasoning.org<http://streamreasoning.org/>

Submitted from an iPhone, I apologise for typos.

From: Julian Hyde <jh...@apache.org>
Reply: dev@calcite.apache.org <de...@calcite.apache.org>
Date: 14 December 2016 at 17:36:27
To: dev@calcite.apache.org <de...@calcite.apache.org>
Subject:  Re: Accessing database metadata

There isn’t a way of doing this currently. But I can see that federating metadata is useful.

The only information that Calcite accesses via its schema SPI is what it needs to prepare queries. I could see us adding an API so that Schema.unwrap(DatabaseMetaData.class) yields a DatabaseMetadata. Then Calcite’s JDBC driver could delegate to it. Log a JIRA case if this is of interest to you.


> On Dec 14, 2016, at 7:54 AM, Riccardo Tommasini <ri...@polimi.it> wrote:
>
> Hi all,
>
> I am trying to access db metadata through calcite. Playing around with the sqline interface and checking the code, I understood that calcite accesses those some metadata using the dedicate jdbc driver. However, some of them are non
> available yet.
>
> Is there a way to access primary keys for a table for instance?
>
> thanks in advance!
>
> Riccardo Tommasini
> Master Degree Computer Science
> PhD Student at Politecnico di Milano (Italy)
> streamreasoning.org<http://streamreasoning.org/>
>
> Submitted from an iPhone, I apologise for typos.


Re: Accessing database metadata

Posted by Julian Hyde <jh...@apache.org>.
There isn’t a way of doing this currently. But I can see that federating metadata is useful.

The only information that Calcite accesses via its schema SPI is what it needs to prepare queries. I could see us adding an API so that Schema.unwrap(DatabaseMetaData.class) yields a DatabaseMetadata. Then Calcite’s JDBC driver could delegate to it. Log a JIRA case if this is of interest to you.


> On Dec 14, 2016, at 7:54 AM, Riccardo Tommasini <ri...@polimi.it> wrote:
> 
> Hi all,
> 
> I am trying to access db metadata through calcite. Playing around with the sqline interface and checking the code, I understood that calcite accesses those some metadata using the dedicate jdbc driver. However, some of them are non
> available yet.
> 
> Is there a way to access primary keys for a table for instance?
> 
> thanks in advance!
> 
> Riccardo Tommasini
> Master Degree Computer Science
> PhD Student at Politecnico di Milano (Italy)
> streamreasoning.org<http://streamreasoning.org/>
> 
> Submitted from an iPhone, I apologise for typos.