-
Notifications
You must be signed in to change notification settings - Fork 8
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
Some additional attributes #12
Comments
The [Trim] attribute is useful, but what would the [DefaultValue] do exactly? Is this server-side or client-side? If it's server-side, it would require a read-back of the record after it's been created |
DefaultValue is for setting default constraints on fields e.g. it's not unusual to have a date/time field in tables named WhenCreated with a default value of getUTCdate() (SQL Server specific in this case). So the specification would be [Column.Default(value = "SQL Value Here")] Hope that makes it clear. |
FYI: The value of the defaults would be specific SQL strings so they would not be database agnostic. |
Why not set the default value on the server once the table is created? For Sqlite I could see the value of this, but not for server-based databases. |
I'm looking at it from the automatic database generation part of Iridium where if the table is not present it automatically creates it. Which is great, but I found that Iridium was not capable of doing this part. I had a couple of choices, use Fluent.Migrations or similar or add an attribute that allowed Iridium to do this as part of it's design. Why do you not think this would be useful for server based databases, other than the fact that you can set them up outside of Iridium, which you can also do with SQLite. That said, I think I see your point. Iridium has the automatic table creation for dealing with a blank SQLite database, but is not designed to do the same for a server-base database. |
I'm thinking of adding a couple of additional attributes to the project.
[Column.DefaultValue(value = "getUTCdate()")], and
[Trim] (Originally available in Vici.CoolStorage)
What are your thoughts on this? Are there any reasons for not doing them?
The text was updated successfully, but these errors were encountered: