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

Why did the Tabla class get split into type families? #16

Closed
expipiplus1 opened this issue Jan 6, 2017 · 2 comments
Closed

Why did the Tabla class get split into type families? #16

expipiplus1 opened this issue Jan 6, 2017 · 2 comments

Comments

@expipiplus1
Copy link
Contributor

This seems to have changed in commit 630c6bd: changed api a lot

One advantage of the class representation is that sensible defaults can be given for fields such as SchemaName.

A slightly related issue: #12

@k0001
Copy link
Owner

k0001 commented Jan 6, 2017

Yeah, that commit reorganized much stuff. Mostly just a general cleanup.

In practice, I don't think there's much difference between the standalone type families vs. the typeclass and associated types approach in this case. I tried both, and the current one seemed a bit cleaner.

That thing you mention about things like SchemaName having a default is a minor but interesting point. I actually don't like the idea of providing a default here. With tisch, I'm trying to make it as hard as possible to shot yourself in the foot, and being explicit about things is a good way to achieve that. Granted, having a default schema name is not a big deal, but still I'd prefer people to understand where their tables are found so that they can better relate to the generated SQL, error messages, and such.

@expipiplus1
Copy link
Contributor Author

That's understandable regarding defaults.

One nice thing about doing this in a class is that there's one central place for the user to see what they need to define for their table to work.

If you say that it's cleaner this way I'm happy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants