Enhancement: Include new table type "VIRTUAL TABLE"

Aperta
#711 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java, sqlite
Ambito
database

Direzione di ricerca

Start by reading the JDBC DatabaseMetaData.getTables implementation and its tests in sqlite-jdbc; the issue does not name their file paths. Compare its table type handling with the proposed sqlite_master query, paying attention to virtual tables when extensions are unavailable. Done means virtual tables are reported as VIRTUAL TABLE and are omitted by default when callers request only ordinary tables; add coverage for both behaviors.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement:JDBC

Include new table type "VIRTUAL TABLE". This way, by default, virtual tables will not be shown in a get tables call. Also, if an extension is not loaded, the call will not error out.

A technique described in How to fetch names of virtual tables? could be used, with the get tables SQL looking something like:

SELECT
  NULL AS TABLE_CAT,
  NULL AS TABLE_SCHEM,
  NAME AS TABLE_NAME,
  TYPE AS TABLE_TYPE,
  NULL AS REMARKS,
  NULL AS TYPE_CAT,
  NULL AS TYPE_SCHEM,
  NULL AS TYPE_NAME,
  NULL AS SELF_REFERENCING_COL_NAME,
  NULL AS REF_GENERATION
FROM
  (
    SELECT
      NAME,
      UPPER(TYPE) AS TYPE
    FROM
      sqlite_master
    WHERE
      NAME NOT LIKE 'sqlite\_%' ESCAPE '\'
      AND SQL NOT LIKE 'CREATE VIRTUAL TABLE%';
      AND UPPER(TYPE) IN ('TABLE', 'VIEW')
    UNION ALL    
    SELECT
      NAME,
      'VIRTUAL TABLE' AS TYPE
    FROM
      sqlite_master
    WHERE
      NAME NOT LIKE 'sqlite\_%' ESCAPE '\'
      AND SQL LIKE 'CREATE VIRTUAL TABLE%';
      AND UPPER(TYPE) IN ('TABLE', 'VIEW')
    UNION ALL
    SELECT
      NAME,
      'GLOBAL TEMPORARY' AS TYPE
    FROM
      sqlite_temp_master
    UNION ALL
    SELECT
      NAME,
      'SYSTEM TABLE' AS TYPE
    FROM
      sqlite_master
    WHERE
      NAME LIKE 'sqlite\_%' ESCAPE '\'
  )
 WHERE TABLE_NAME LIKE '%' AND TABLE_TYPE IN ('TABLE','VIEW') ORDER BY TABLE_TYPE, TABLE_NAME;
Lingua principale
Java
Stelle
3.3k
Fork
676
Merge medio
1g 15h
PR unite (30g)
18

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di xerial/sqlite-jdbc

Tutte le issue di xerial/sqlite-jdbc

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.