Enhancement: Include new table type "VIRTUAL TABLE"

Abierto
#711 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
java, sqlite
Área
database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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;
Lenguaje dominante
Java
Estrellas
3.3k
Forks
676
Merge medio
1 d 15 h
PR fusionados (30 d)
18

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de xerial/sqlite-jdbc

Todos los issues de xerial/sqlite-jdbc

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.