Lighter-swift / Lighter

Swift APIs for SQLite: Type-safe down to the schema. Very, very, fast. Dependency free.
https://lighter-swift.github.io/documentation/lighter/
MIT License
459 stars 12 forks source link

Enlighten generates ambigous symbols if `Table` shares name of `Database` #32

Closed JoeMatt closed 1 month ago

JoeMatt commented 2 months ago

If a Database has a Table of the same name, ambiguous references are created.

Example database; https://github.com/SnowflakePowered/shiragame/releases/latest/download/shiragame.zip

To reproduce

  1. Insert Shiragame.sqlite3
  2. Use swift pm plugin to generate
  3. Build

Workaround; Edit the database Table name to something unique e.g. Shiragame_metadata

helje5 commented 2 months ago

Hm, yes, the easy fix is to just rename the DB to ShiragameDB.db (I think there is also a config option to specify the database type name). But yes, Enlighter should just check whether there is a table naming conflict w/ the DB, and add "Database" or "DB" automatically for the default name.