Jeff-Lewis / codesmith

Automatically exported from code.google.com/p/codesmith
0 stars 0 forks source link

Enhancement: Separate generated files by Schema #144

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This is actually an Enhancement request.

I have a database with several schemas, and I am wondering what would it 
take to do sub folders for each schema...?

Such as:
Entities/dbo/generated files here
Entities/schema1/generated files here
Entities/schema2/generated files here

Rather then all the generated files in the root Entities folder...

This would also apply to the Manager and Query files as well.

Could we get a property in the .cst which says "Separate By Schema: 
Yes/No" so that it is optional? I would guess that would be in the Entity, 
Manager and Query .cst templates.

Thanks,
Troy

Original issue reported on code.google.com by t...@troyzarger.com on 23 Sep 2009 at 1:24

GoogleCodeExporter commented 9 years ago
Would you expect the namespaces to be the same for entities in different 
schemas?

e.g.
Company.Data.Entity (for dbo schema)
Company.Data.Schema1.Entity

We are thinking of implementing this only if multiple schemas exist and that 
the 
number of tables in a schema is greater than 5 tables.  Thoughts?

We are considering this as a feature.

Original comment by shannon....@gmail.com on 2 Oct 2009 at 4:32

GoogleCodeExporter commented 9 years ago
I was expecting the Namespace to be the same... However, now that you mention 
it, 
that might be a good idea since you could have name collisions within the 
Schemas.

If you simply appended the schema to the ContextNameSpace space such 
as "Company.Data.Schema1" ... that would be a nice solution as you stated. And 
yes, 
dbo could always retain no schema name and default the ContextNameSpace 
specified.

If you do implement this feature (which a greatly would appreciate) ... why the 
limitation of 5 tables minimum per Schema? Sometimes as I am building out a 
database, the schema may be limited in number of tables, but grows over 
development 
process. Also, are you considering multiple schemas to be 2 or more? Would you 
have 
a setting in the DBML file such as "Separate By Schemas: True/False"? Or would 
it 
automatically happen?

Also, if implemented, please do not lose site if segregating the generated 
files 
within sub folders of the Entities and Managers and Queries folders.

Thanks for you your time and consideration, this would be a tremendous help in 
some 
cases were a DB may have large number of tables, but broken up under a few 
schemas 
or more.

Troy

Original comment by t...@troyzarger.com on 2 Oct 2009 at 7:22

GoogleCodeExporter commented 9 years ago
We agree that the 5 table limit would probably cause confusion.  We are adding 
this to 
the backlog.

Original comment by shannon....@gmail.com on 6 Oct 2009 at 3:54

GoogleCodeExporter commented 9 years ago
Any progress on this one? I have a DB designer fond of using multiple schemas. 
:)

Original comment by tyler.je...@gmail.com on 11 Mar 2010 at 3:33

GoogleCodeExporter commented 9 years ago
I also would like to see this feature implemented because our team is also very 
fond 
of using schemas and there are definately name collisions occurring on the 
tables.

Original comment by wkpa...@gmail.com on 2 Jun 2010 at 12:41

GoogleCodeExporter commented 9 years ago
Hello,

If someone would be willing to work together on this issue. I'll help with 
guidance on implementing this. It will be a slightly big task as namespace 
issues will need to be worked out.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 27 Jul 2010 at 3:33

GoogleCodeExporter commented 9 years ago
I would like to go on record as duplicating wkparry's comment (#5 above).
Thanks,
MilesT

Original comment by milestho...@hotmail.com on 3 Aug 2010 at 9:39

GoogleCodeExporter commented 9 years ago
Blake,

I could provide some help on contributing to this effort.  I can certainly 
start by providing you with the changes I've made so far to my templates to 
produce objects that include the schema in table names.  However, I know we 
eventually want to separate out namespaces for schemas (I think this is more 
desireable) which is not exactly what I've done at this point.  You can email 
me directly if you have suggestions for how to move forward with this.

Warren

Original comment by wkpa...@gmail.com on 13 Aug 2010 at 2:31

GoogleCodeExporter commented 9 years ago
Issue 608 has been merged into this issue.

Original comment by bniemyjski on 28 Nov 2011 at 2:35