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

Is there a way to generate only certain tables? #1

Open
Ed156 opened this issue Feb 1, 2020 · 3 comments
Open

Is there a way to generate only certain tables? #1

Ed156 opened this issue Feb 1, 2020 · 3 comments

Comments

@Ed156
Copy link

Ed156 commented Feb 1, 2020

Thank you for the great tool. I am moving from the T4 templates.
On one of those T4 templates I used some code to be able to ignore all tables except the explicit table list.

var tableFilter = new List<string>();
tableFilter.Add("BaseRep");
tableFilter.Add("BaseRepField");
tableFilter.Add("Rep");

var tables = LoadTables();

foreach (var table in tables)
{
	if(!tableFilter.Contains(table.ClassName))
		table.Ignore = true;
}

If I see it correctly this now cannot be done, so I would have to explicitly Ignore all the other tables.

So it would be great if there is a general Ignore setting for tables, so only explicit tables are generated.

@leigh-pointer
Copy link

Is this not what you require?

You can do table customization(e.g. table ignore, entity name change, columns customization) with a config file. Sample config file can be found in source code sample_config.json.

@Ed156
Copy link
Author

Ed156 commented May 15, 2020

Not exactly, I use that as well in other cases, but that is for explicitly ignoring tables.

There are cases where only some, say 5% percent of the tables should be generated. With the current options I would have explicitly ignore 95% of the tables. So in my case, it would be handy if it can be turned around: explicitly include thos 5% and ignore all others.

@geoffbeaumont
Copy link

I'd say this is a very common use case - for example, I'm currently working on a data syncing console application. It only needs to access half a dozen tables from a database containing about 150 tables. It would be preferable not to clutter up the code with large numbers of unused POCO classes, but explicitly excluding them in the config file will be a fair bit of graft and prone to new tables not being added to the list.

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

3 participants