Skip to content

find-refs fails to open database: "Connection string keyword 'version' is not supported" #72

Description

@SkowronskiAndrew

Summary

The find-refs command fails immediately when opening a database produced by analyze:

$ UnityDataTool find-refs out.db -n red -t Texture2D
Error opening database: Connection string keyword 'version' is not supported. For a possible alternative, see https://go.microsoft.com/fwlink/?linkid=2142181.

This was reported on internal Slack but the cause wasn't clear at the time. It reproduces consistently with any analyze database.

Cause

The reference finder builds a SQLite connection string using a legacy keyword (Version=...) from the old System.Data.SQLite provider. The project uses Microsoft.Data.Sqlite, which does not recognize that keyword and throws on open. The analyze/SQLiteWriter path builds its connection string correctly via SqliteConnectionStringBuilder, so only the ReferenceFinder code path is affected.

Fix direction

Build the connection string with SqliteConnectionStringBuilder (matching SQLiteWriter) instead of hand-writing a System.Data.SQLite-style connection string. To be addressed in a follow-up PR.

Repro

UnityDataTool analyze -o out.db -p "*.cf" <ContentDirectory build>
UnityDataTool find-refs out.db -n red -t Texture2D

Related

Related to #44 (refs table work).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions