mono DbMetal.exe /provider=PostgreSql \
/conn="database=OGo;username=OGo;host=localhost" \
/dbml=OGoDB.dbml -database:OGo \
-namespace:Org.OpenGroupware /entityBase:OGoEntity
- but the file it generated is extremely sparse (which is possibly
correct, I guess).
On Thu, 2008-12-11 at 19:05 +0100, Pascal Craponne wrote:
> here are two kinds samples of rename files in the source code
> (in src/DbMetal):
> - xml files (DbMetal specific), pgsqlFieldRenames.xml and
> oraFieldRenames.xml
> - DBML files (I started to implement something to get closer to the
> original SqlMetal), like NorthwindRename.dbml There are still some
> problems, but it works fine for columns and classes (less fine for
> associations).
Is there a way to generate a default DBML that contains all the data and
then edit it, or do I have to create it from scratch? When I do
"/dbml=OGoDB.dbml" the DBML file is *very* sparse and contains only
references to tables (no references to fields), like:
<Table Name="public.article" Member="Article">
<Type Name="Article" />
</Table>
But if I generate classes they do domain setter/getters for all the
fields.
The alias method (like pgsqlFieldRenames.xml) seems to work for both
fields and tables, so that may be sufficient; just seems like DBML is
the richer solution.
No.
awilliam@linux-nnci:~/tmp/DbLinq> mono
DbMetal.exe /provider=PostgreSql /conn="database=OGo;username=OGo;host=localhost" -namespace:Org.OpenGroupware /entityBase:OGoEntity /code=OGoDB.cs -database:OGo
awilliam@linux-nnci:~/tmp/DbLinq> wc -l OGoDB.cs
21251 OGoDB.cs
This contains what looks like a full assembly of classes, whereas -
awilliam@linux-nnci:~/tmp/DbLinq> mono
DbMetal.exe /provider=PostgreSql /conn="database=OGo;username=OGo;host=localhost" -namespace:Org.OpenGroupware /entityBase:OGoEntity /dbml=OGoDB.dbml -database:OGo
awilliam@linux-nnci:~/tmp/DbLinq> wc -l OGoDB.dbml
161 OGoDB.dbml
Nothing but:
<?xml version="1.0" encoding="utf-8"?>
<Database xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name=""OGo""
EntityNamespace="Org.OpenGroupware" ContextNamespace="Org.OpenGroupware"
Class="OgO" BaseType="DbLinq.Data.Linq.DataContext"
Provider="PostgreSql"
xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">
<Table Name="public.address" Member="Address">
<Type Name="Address" />
</Table>
.... more empty <Table ..><Type .../></Table> entries .....
</Database>
So it contains no associations and no field name data.
DbLinq Database mapping generator 2008 version 0.18.0.0
mono-core-2.0.1-18.1.i586
Linux linux-nnci 2.6.25.18-0.2-pae
--
Consonance: an Open Source .NET OpenGroupware client.
Contact:awil...@whitemiceconsulting.com http://freshmeat.net/projects/consonance/
I can try; but it doesn't build on Mono. I opened the VS solution on
Monodevelop just fine, but compilation fails.
I removed all the projects from the solution except DbLinq,
DbLinq.PostgreSql, DbMetal, and System.Data.Linq. Building DbLinq
succeeds but DbLinq.PostgreSql fails with:
[Task:File=, Line=0, Column=0, Type=Error, Priority=Normal,
Description=Friend access was granted to `DbLinq.PostgreSql,
PublicKeyToken=61e015a67077348b', but the output assembly is named
`DbLinq.PostgreSql, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null'. Try adding a reference to `DbLinq.PostgreSql,
PublicKeyToken=61e015a67077348b' or change the output assembly name to
match it(CS0281)]
> Can I ask you to submit a patch once the solution builds? I'll commit
> it to the repository.
I've got it signing, and have moved onto the next error. :)
I have to add "[assembly: AssemblyKeyFile ("../DbLinq.snk")]" to the
AssemblyInfo.cs of the various projects. And setup Monodevelop to sign
the assemblies (note: this requires working around Monodevelop
bug#461702 <https://bugzilla.novell.com/show_bug.cgi?id=461702>).
Now building DbMetal fails with:
[Task:File=/home/awilliam/Works/DbLinq/dblinq2007-read-only/src/DbMetal/Configuration/ProvidersSection.cs, Line=39, Column=37, Type=Error, Priority=Normal, Description=The type or namespace name `ConfigurationSection' could not be found. Are you missing a using directive or an assembly reference?(CS0246)]
[Task:File=/home/awilliam/Works/DbLinq/dblinq2007-read-only/src/DbMetal/Configuration/ProvidersSection.cs, Line=41, Column=40, Type=Error, Priority=Normal, Description=The type or namespace name `ConfigurationElement' could not be found. Are you missing a using directive or an assembly reference?(CS0246)]
[Task:File=/home/awilliam/Works/DbLinq/dblinq2007-read-only/src/DbMetal/Configuration/ProvidersSection.cs, Line=62, Column=44, Type=Error, Priority=Normal, Description=The type or namespace name `ConfigurationElementCollection' could not be found. Are you missing a using directive or an assembly reference?(CS0246)]
mono-core-2.0.1-18.1.i586
monodevelop-1.9-1.3.noarch
Okay, there was a reference in the DbMetal project to
"System.configuration", once I removed that and added a reference to
"System.Configuration", it *almost* builds!
Now it just dies with -
[Task:File=, Line=0, Column=0, Type=Error, Priority=Normal,
Description=File
'/home/awilliam/Works/DbLinq/dblinq2007-read-only/src/DbMetal/bin/DbMetal.exe.mdb' not found]
[Task:File=, Line=0, Column=0, Type=Error, Priority=Normal,
Description=/tmp/tmp525d0308.tmp]
Think so, switching from Debug to Release reduces the error message to
just:
[Task:File=, Line=0, Column=0, Type=Error, Priority=Normal,
Description=/tmp/tmp249b9816.tmp]
> and it is Mono specific. Can one of the Mono guys reading this
> message give a hand?
> > Now it just dies with -
Got a thread over at
<http://lists.ximian.com/pipermail/monodevelop-list/2008-December/008757.html>
Sadly, it still fails with the new Mono 2.2.
Exception caught by the compiler while compiling:
Block that caused the problem begin
at: /home/awilliam/Works/DbLinq/dblinq2007-read-only/src/DbMetal/Generator/Implementation/CodeTextGenerator/CodeGenerator.Class.cs(588,99):
Block being compiled:
[/home/awilliam/Works/DbLinq/dblinq2007-read-only/src/DbMetal/Generator/Implementation/CodeTextGenerator/CodeGenerator.Class.cs(588,104):,/home/awilliam/Works/DbLinq/dblinq2007-read-only/src/DbMetal/Generator/Implementation/CodeTextGenerator/CodeGenerator.Class.cs(588,118):]
System.Exception: Expression Mono.CSharp.LocalVariableReference did not
set its type after Resolve
Supposedly this has been fixed in trunk.
<https://bugzilla.novell.com/show_bug.cgi?id=447807>
It actually happens in DataContext.cs
[Task:File=/home/ekot/prg/dblinq/dblinq2007-read-only/src/DbLinq/Data/Linq/DataContext.cs,
Line=485, Column=63, Type=Error, Priority=Normal, Description=The call is
ambiguous between the following methods or properties:
`System.Linq.Expressions.Extensions.IsNullable(this System.Type)' and
`DbLinq.Util.TypeExtensions.IsNullable(this System.Type)'(CS0121)]
Pascal Craponne wrote:
>
> do you still get this problem?
>
No they fixed it.
There appeared another problem though
/home/ekot/prg/dblinq2007/src/DbLinq/Test/Providers/Linq_101_Samples/Count_Sum_Min_Max_Avg.cs(240,67):
error CS0019: Operator `>' cannot be applied to operands of type `decimal?'
and `double'
/home/ekot/prg/dblinq2007/src/DbLinq/Test/Providers/Linq_101_Samples/Count_Sum_Min_Max_Avg.cs(245,35):
error CS0411: The type arguments for method
`System.Linq.Enumerable.ToList<TSource>(this
System.Collections.Generic.IEnumerable<TSource>)' cannot be inferred from
the usage. Try specifying the type arguments explicitly
/home/ekot/prg/dblinq2007/src/DbLinq/Test/Providers/Linq_101_Samples/Count_Sum_Min_Max_Avg.cs(246,32):
error CS0019: Operator `>' cannot be applied to operands of type `method
group' and `int'
This has been filed and fixed:
https://bugzilla.novell.com/show_bug.cgi?id=482996
Alas, it was fixed in trunk, after Mono 2.4 was branched. So you'll
either need to wait for Mono 2.6, or build Mono from trunk; see:
http://www.mono-project.com/Parallel_Mono_Environments
- Jon