Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name conflict in raw fetches (sqlite3_talents0_fetch) #12

Closed
helje5 opened this issue Aug 24, 2022 · 1 comment
Closed

Name conflict in raw fetches (sqlite3_talents0_fetch) #12

helje5 opened this issue Aug 24, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@helje5
Copy link
Member

helje5 commented Aug 24, 2022

When generating a DB for this:

CREATE TABLE Talents (
    id   UUID PRIMARY KEY NOT NULL,
    name TEXT NOT NULL
);

The result is mostly OK, but ends up with those SQLite API functions:

public func sqlite3_talents0_fetch(...)

Notice the talents0, it is probably generated by the code which makes the identifiers unique. The CUD functions are fine though:

public func sqlite3_talents_delete(...)
@helje5 helje5 added the bug Something isn't working label Aug 24, 2022
@helje5
Copy link
Member Author

helje5 commented Aug 24, 2022

This happened because the table name is plural already, and singularizeRecordNames is set to false by default. I.e. "talents" already is plural and then clashes with the singular "talents". Changed the fancifier to detect that and deal with the case properly.

@helje5 helje5 closed this as completed Aug 24, 2022
helje5 added a commit that referenced this issue Aug 24, 2022
When the plural and the singular raw name was the same,
the deduper kicked in and added a `0`, e.g.
```swift
func sqlite3_talents0_fetch()
```

This happened because the `talents` was plural already
(and hence ended up with the same name).
This only happens w/ `singularizeRecordNames` set to
false (the default).

Fixes issue #12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant