Skip to content

Improve SQLite types handling. #1747

@AndreiKingsley

Description

@AndreiKingsley

Orginal problem in #964.

In order to support custom types not handled correctly by SQLite type affinity, custom type mapping possibility was added in #1741.

However that might not be enough. Now we only support type definitions based on sqlTypeName. However, this may not be the single determining factor.
So it seems that there are a lot of edge cases of determining the JDBC type in SQLite, and several column type determination mechanisms can be particularly relevant for it:

  • column name -> type (colTypes: Map<String, ColType>)
  • may be column metadata (not only sqlTypeName) -> type
  • inferring from values?

It's also important not only for custom types, but for simple INTEGER nullable columns .
Xerial SQLite JDBC driver seems to give identical metadata for them, however actually types of values can be both Int? and Long? (looks like a separate issue perhaps).

TableColumnMetadata(name='int_col', sqlTypeName='INTEGER', jdbcType=4, size=2147483647, javaClassName='java.lang.Object', isNullable=true)
TableColumnMetadata(name='long_col', sqlTypeName='INTEGER', jdbcType=4, size=2147483647, javaClassName='java.lang.Object', isNullable=true)

Need to investigate different usecases and and practices and improve handling of SQLite types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdatabasesJDBC related issuesresearchThis requires a deeper dive to gather a better understanding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions