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

Default table names don't work for types with generics #67

Open
mdiep opened this issue Jun 20, 2020 · 0 comments
Open

Default table names don't work for types with generics #67

mdiep opened this issue Jun 20, 2020 · 0 comments
Labels

Comments

@mdiep
Copy link
Collaborator

mdiep commented Jun 20, 2020

If declare a generic type to be a model, then the default table name will have angle brackets.

struct Foo<V> {
  var id: V
}

extension Foo: PersistDB.Model where V == Int {
  static let schema = Schema<Foo>(
    Foo.init ~ "Bar" // schema is named "Bar" here
    \.id ~ "id"
  )
}

This breaks some of the SQL.

@mdiep mdiep added the bug label Jun 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant