This is a migrated thread and some comments may be shown as answers.

Firebird create database script

6 Answers 161 Views
Databases and Data Types
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jean
Top achievements
Rank 1
Jean asked on 03 Jul 2012, 08:56 AM
Hello,
I'm using OA with Firebird (I'm making tests).
I create a Domain class, I add some properties and if I look at the database script generated, all the identifiers are lowercase and between ".

For example :
/* Data.Syndic */
CREATE TABLE "syndic" (
    "lib" varchar(190),                     /* _lib */
    "id" INTEGER NOT NULL,                  /* _id */
    CONSTRAINT "pk_syndic" PRIMARY KEY ("id")
);

Ok, it should work like this but it's a big problem using the database with another tool (or even for end users for making queries).

Is there a way force generated sql identifiers to be uppercase (the way firebird works) and remove those " ?

Thank you.

Jean

6 Answers, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 05 Jul 2012, 12:11 PM
Hello Jean,

 I am afraid that currently there is no way to specify any means of naming strategy for a forward mapping scenario. The idea behind this is basically the fact that when using an ORM you shouldn't really care that much for the database anyway. 
Regardless of what gets generated on the database side you can always manipulate what gets generated in your application using our naming settings for reverse map.
The good news is that we are planning to introduce naming setting strategies for forward mapping scenarios that would be pretty much the same as the one we now have for reverse mapping. This however is a future project that will be available with Q3 earliest.

Regards,
Petar
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
0
Jean
Top achievements
Rank 1
answered on 05 Jul 2012, 04:03 PM
Ok, thank you.

I understand that within my application, it is not a problem. But I know that someday, some of my customers will have to develop a specific software that interacts with ma database... And the queries wont be easy to write, helas.

The problem is I'm making important choices today. EF or OA (or anything else), Firebird or SqlServer. It's not easy et I don't know if I can wait till Q3...
Thank you anyway.

Jean
0
PetarP
Telerik team
answered on 05 Jul 2012, 04:51 PM
Hi Jean,

Will it be ok for you if we provide you with an internal build containing functionality to generate your schema name based on your model names (without changing the casing and adding the underscores and etc).
If that works for you I think we can provide you with an internal build by the end of July.
I am looking forward to your reply.

All the best,
Petar
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
0
Jean
Top achievements
Rank 1
answered on 06 Jul 2012, 06:55 AM
Hello Petar,

That would be great. But I dont't know if I correctly explained the problem.

If my model is for example :

User
  ID
  Name
  GroupID

The schema will be somthing like :

Create Table "Users" (
  "ID" integer,
  "Name" varchar...
)

And it works but all queries (even those made with other programs) need to mark identifiers with ". For example :
  Select "User"."Name" FROM "Users" join "Other" On "Groups"."ID"="Users"."GroupID"
etc.
And it's not allways easy.

The schema generator should generate identifiers without " (sorry I don't know the english word for "). At least with Firebird. Firebird is case independant except if identifiers are between ".

Of course, if you can send me something to try, I can test if the result is what I need.

For now, I'm testing OA using an hand made database (Update model from database...)

Cordialement.

Jean

0
Jean
Top achievements
Rank 1
answered on 06 Jul 2012, 07:05 AM
I forgot something,

I saw a problem in the process of creating the model from the database. I don't know if I should explain here or if there is a place to report bugs.

With Firebird, il the table column type is defined with a domain, the "not null" information eventually defined within the domain is not used and the Field member of the model can be null.

Jean
0
PetarP
Telerik team
answered on 10 Jul 2012, 09:43 AM
Hello Jean,

 Since this is an issue for you we will expose a setting to turn off the automatic escaping of the relational names we generate. This way you will be able to turn off this setting for your project and hopefully that will do the trick for you.
I will contact you back in this thread once we have a working solution.

All the best,
Petar
the Telerik team
OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
Tags
Databases and Data Types
Asked by
Jean
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Jean
Top achievements
Rank 1
Share this question
or