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

Insert method #35

Closed
nicholassuter opened this issue Feb 6, 2012 · 4 comments
Closed

Insert method #35

nicholassuter opened this issue Feb 6, 2012 · 4 comments
Labels

Comments

@nicholassuter
Copy link

I am currently migrating from Fluent Migrator to MigSharp, and the only feature I miss is an IDatabase.Insert() method such as :
Insert.IntoTable("Users").Row(new { FirstName = "John", LastName = "Smith" });
(https://github.com/schambers/fluentmigrator/wiki/Fluent-Interface)

I know I can work around this with IDatabase.Execute(), but an Insert method is cleaner, easier to write and most of all written in C# and not SQL.

@dradovic
Copy link
Owner

dradovic commented Feb 7, 2012

Notice that Mig# does not offer any data manipulating operations. It is about schema changes only because this is the part, where different platforms differ and there are no standards.

As for data manipulation such as inserting, updating, deleting records, or copying tables, etc., it can be done in many ways. The syntax you present is only one possibility, but there are plenty other approaches which might be more suitable for different users. There are libraries that specifically address this concern. To add this to Mig# would mean to open a door to a completely different area and I don't want to do this to keep the scope of Mig# well defined and lean.

Note that you could easily implement your own extension method on IDatabase that provides you what you need.

@nicholassuter
Copy link
Author

I did notice :)
The syntax I gave was exactly what you said : an example. I just found these methods really convenient in Fluent Migrator, since this enabled me to replace all my SQL scripts by C# migrations : manipulating the schema and populating the tables. When you mention other libraries, I suppose you mean ADO.NET and untyped DataSets for instance.


De: dradovic reply@reply.github.com
: nicholassuter nicholas_suter@yahoo.fr
Envoy le : Mardi 7 fvrier 2012 7h01
Objet: Re: [MigSharp] Insert method (#35)

Notice that Mig# does not offer any data manipulating operations. It is about schema changes only because this is the part, where different platforms differ and there are no standards.

As for data manipulation such as inserting, updating, deleting records, or copying tables, etc., it can be done in many ways. The syntax you present is only one possibility, but there are plenty other approaches which might be more suitable for different users. There are libraries that specifically address this concern. To add this to Mig# would mean to open a door to a completely different area and I don't want to do this to keep the scope of Mig# well defined and lean.

Note that you could easily implement your own extension method on IDatabase that provides you what you need.


Reply to this email directly or view it on GitHub:
#35 (comment)

@dradovic
Copy link
Owner

dradovic commented Feb 7, 2012

There are a couple of other libraries. I remember evaluating some, that it's too long to remember names. I just found http://www.codeproject.com/Articles/16610/SQL-Statement-Generator and http://stackoverflow.com/questions/7172008/c-sql-query-builder-class with a quick Google search. But there are others, too...

@dradovic
Copy link
Owner

dradovic commented Dec 5, 2012

In order to keep the scope of Mig# clearly defined (schema ops and not data ops), this feature will not be implemented. As said, there are other libraries out there that provide this functionality.

@dradovic dradovic closed this as completed Dec 5, 2012
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

2 participants