Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
 1. Generator ID. One for all is bad options for me. I'll reimplement it to 
 have one for table.

That's why it's open.

 2. Couple of errors in creating Constraints or Indexes:
unsuccessful metadata update
Name longer than database column size
Constraint names are longer than it can be in system tables: ALTER TABLE 
ClientGroupAlerts ADD CONSTRAINT 
FK_ClientGroupAlerts_ClientGroups_ClientGroup_Id. I've figured that maximum 
name is 31 (!!!) characters. I've implemented SHA1 (maybe I will replace it 
with something faster) hashing of string names.

Yeah. Firebird's 31 characters it's goign to be hard to beat. I can shorten the 
string, but that will increase collisions. Maybe we can create - similar to 
generators - open ended method that anybody can override if needed.

-- 
Mgr. Jiří Činčura
Independent IT Specialist


--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
Your configuration for context needs to derive from FbDbConfiguration. So far 
there's no better solution. The migrations are run in serializable transaction 
and you need to insert into __MigrationHistory right after creation. Disaster.

-- 
Mgr. Jiří Činčura
Independent IT Specialist

From: Геннадий Забула [mailto:zabulu...@gmail.com] 
Sent: Tuesday, December 30, 2014 8:19 AM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] EF Migrations

Fall in next query:
EXECUTE BLOCK
AS
BEGIN
EXECUTE STATEMENT
'CREATE TABLE __MigrationHistory (
MigrationId VARCHAR(150) NOT NULL, 
ContextKey VARCHAR(300) NOT NULL, 
Model BLOB SUB_TYPE BINARY NOT NULL, 
ProductVersion VARCHAR(32) NOT NULL
)'
WITH AUTONOMOUS TRANSACTION;
END
Parameters:
With next exception:
unsuccessful metadata update
STORE RDB$RELATIONS failed
lock conflict on no wait transaction

2014-12-30 9:03 GMT+02:00 Геннадий Забула zabulu...@gmail.com:
Here are my issues/suggestions:
1. Generator ID. One for all is bad options for me. I'll reimplement it to have 
one for table.
2. Couple of errors in creating Constraints or Indexes:
unsuccessful metadata update
Name longer than database column size
Constraint names are longer than it can be in system tables: ALTER TABLE 
ClientGroupAlerts ADD CONSTRAINT 
FK_ClientGroupAlerts_ClientGroups_ClientGroup_Id. I've figured that maximum 
name is 31 (!!!) characters. I've implemented SHA1 (maybe I will replace it 
with something faster) hashing of string names.

Will write about further progress.

2014-12-20 8:32 GMT+02:00 Mercea Paul paul.mer...@almexa.ro:
On 2014.11.06 3:06 PM, Jiří Činčura wrote:
 Hi *,

 Anybody here willing to give EF Migrations a try? I'm getting close to first 
 implementation.

I'm trying to add support for Firebird db for existing app on SQL
Express, and, first run of the application was with no errors and
created the database.
I'll going to try migrations steps and give feedback.

Thanks Jiri

Paul MERCEA
___
E-mail: paul.mer...@almexa.ro
___


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
 Your configuration for context needs to derive from FbDbConfiguration. So
far there's no better solution. The migrations are run in serializable
transaction and you need to insert into __MigrationHistory right after
creation. Disaster.

I'm using the same Context for both MSSQL and Firebird, how deriving from
FbDbConfiguration can affect MSSQL code path? Can we override this somehow
just in Firebird provider?

 Yeah. Firebird's 31 characters it's goign to be hard to beat. I can
shorten the string, but that will increase collisions. Maybe we can create
- similar to generators - open ended method that anybody can override if
needed.

I like this.


2014-12-30 10:06 GMT+02:00 Jiří Činčura j...@cincura.net:

 Your configuration for context needs to derive from FbDbConfiguration. So
 far there's no better solution. The migrations are run in serializable
 transaction and you need to insert into __MigrationHistory right after
 creation. Disaster.

 --
 Mgr. Jiří Činčura
 Independent IT Specialist

 From: Геннадий Забула [mailto:zabulu...@gmail.com]
 Sent: Tuesday, December 30, 2014 8:19 AM
 To: For users and developers of the Firebird .NET providers
 Subject: Re: [Firebird-net-provider] EF Migrations

 Fall in next query:
 EXECUTE BLOCK
 AS
 BEGIN
 EXECUTE STATEMENT
 'CREATE TABLE __MigrationHistory (
 MigrationId VARCHAR(150) NOT NULL,
 ContextKey VARCHAR(300) NOT NULL,
 Model BLOB SUB_TYPE BINARY NOT NULL,
 ProductVersion VARCHAR(32) NOT NULL
 )'
 WITH AUTONOMOUS TRANSACTION;
 END
 Parameters:
 With next exception:
 unsuccessful metadata update
 STORE RDB$RELATIONS failed
 lock conflict on no wait transaction

 2014-12-30 9:03 GMT+02:00 Геннадий Забула zabulu...@gmail.com:
 Here are my issues/suggestions:
 1. Generator ID. One for all is bad options for me. I'll reimplement it to
 have one for table.
 2. Couple of errors in creating Constraints or Indexes:
 unsuccessful metadata update
 Name longer than database column size
 Constraint names are longer than it can be in system tables: ALTER TABLE
 ClientGroupAlerts ADD CONSTRAINT
 FK_ClientGroupAlerts_ClientGroups_ClientGroup_Id. I've figured that
 maximum name is 31 (!!!) characters. I've implemented SHA1 (maybe I will
 replace it with something faster) hashing of string names.

 Will write about further progress.

 2014-12-20 8:32 GMT+02:00 Mercea Paul paul.mer...@almexa.ro:
 On 2014.11.06 3:06 PM, Jiří Činčura wrote:
  Hi *,
 
  Anybody here willing to give EF Migrations a try? I'm getting close to
 first implementation.
 
 I'm trying to add support for Firebird db for existing app on SQL
 Express, and, first run of the application was with no errors and
 created the database.
 I'll going to try migrations steps and give feedback.

 Thanks Jiri

 Paul MERCEA
 ___
 E-mail: paul.mer...@almexa.ro
 ___



 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE

 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider



 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
I've found out that there is the static class:
System.Data.Entity.Infrastructure.Interception.DbInterception, which adds
IDbInterceptor,

2014-12-30 11:23 GMT+02:00 Jiří Činčura j...@cincura.net:

  I'm using the same Context for both MSSQL and Firebird, how deriving
 from FbDbConfiguration can affect MSSQL code path? Can we override this
 somehow just in Firebird provider?

 You can use the same context. It's just configuration. I'm waiting for
 reply from EF guys to see what other options are.

 --
 Mgr. Jiří Činčura
 Independent IT Specialist



 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
One more thing about naming indexes conventions. Indexes namespace is
global. So if you have several same fields in different tables, you'll have
the same name index for both. Good example in three entities with N:M
relations:
Entity1: eid, name
Entity2: eid, name
Entity3: eid, name
Entity1Entity3: Entity1_eid, Entity3_eid
Entity1Entity2: Entity1_eid, Entity2_eid
Will try to create index IX_Entity1_eid for both tables and fail on this.
I've added the table name to the index name: IX_Entity1Entity3_Entity1_eid,
and as I mentioned before I've experienced long name error.

2014-12-30 11:35 GMT+02:00 Геннадий Забула zabulu...@gmail.com:

 And looks like it works:
 public FbProviderServices()
 {
 #if (EF_6)
 AddDependencyResolver(new
 SingletonDependencyResolverIDbConnectionFactory(new
 FbConnectionFactory()));
 AddDependencyResolver(new
 SingletonDependencyResolverFuncMigrationSqlGenerator(() = new
 FbMigrationSqlGenerator(), ProviderInvariantName));

 System.Data.Entity.Infrastructure.Interception.DbInterception.Add(new
 MigrationsTransactionsInterceptor());
 #endif
 }

 2014-12-30 11:29 GMT+02:00 Геннадий Забула zabulu...@gmail.com:

 I've found out that there is the static class:
 System.Data.Entity.Infrastructure.Interception.DbInterception, which adds
 IDbInterceptor,

 2014-12-30 11:23 GMT+02:00 Jiří Činčura j...@cincura.net:

  I'm using the same Context for both MSSQL and Firebird, how deriving
 from FbDbConfiguration can affect MSSQL code path? Can we override this
 somehow just in Firebird provider?

 You can use the same context. It's just configuration. I'm waiting for
 reply from EF guys to see what other options are.

 --
 Mgr. Jiří Činčura
 Independent IT Specialist



 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take
 a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider




--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
That’s not the same as what AddInterceptor call does.

--
Mgr. Jiří Činčura
Independent IT Specialist

From: Геннадий Забула [mailto:zabulu...@gmail.com]
Sent: Tuesday, December 30, 2014 10:36 AM
To: For users and developers of the Firebird .NET providers
Subject: Re: [Firebird-net-provider] EF Migrations

And looks like it works:
public FbProviderServices()
  {
#if (EF_6)
  AddDependencyResolver(new 
SingletonDependencyResolverIDbConnectionFactory(new FbConnectionFactory()));
  AddDependencyResolver(new 
SingletonDependencyResolverFuncMigrationSqlGenerator(() = new 
FbMigrationSqlGenerator(), ProviderInvariantName));

System.Data.Entity.Infrastructure.Interception.DbInterception.Add(new 
MigrationsTransactionsInterceptor());
#endif
  }

2014-12-30 11:29 GMT+02:00 Геннадий Забула 
zabulu...@gmail.commailto:zabulu...@gmail.com:
I've found out that there is the static class: 
System.Data.Entity.Infrastructure.Interception.DbInterception, which adds 
IDbInterceptor,

2014-12-30 11:23 GMT+02:00 Jiří Činčura 
j...@cincura.netmailto:j...@cincura.net:
 I'm using the same Context for both MSSQL and Firebird, how deriving from 
 FbDbConfiguration can affect MSSQL code path? Can we override this somehow 
 just in Firebird provider?

You can use the same context. It's just configuration. I'm waiting for reply 
from EF guys to see what other options are.

--
Mgr. Jiří Činčura
Independent IT Specialist

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.netmailto:Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
The name for index is created by EF if the explicit value is not provided. 

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
 That’s not the same as what AddInterceptor call does.
As far as I see in the debugger, MigrationsTransactionsInterceptor is
called successfully and failed tests are going further. I've added just one
fix to filter just Firebird connections:
public void BeginningTransaction(DbConnection connection,
BeginTransactionInterceptionContext interceptionContext)
{
if (connection is FbConnection
 interceptionContext.IsolationLevel ==
IsolationLevel.Serializable
 IsInMigrations())
{
interceptionContext.Result =
connection.BeginTransaction(IsolationLevel.ReadCommitted);
}
}
 The name for index is created by EF if the explicit value is not provided.
Name conventions of EF is slightly different from Firebird. We need to
override this in the provider.

2014-12-30 11:57 GMT+02:00 Jiří Činčura j...@cincura.net:

 The name for index is created by EF if the explicit value is not provided.

 --
 Mgr. Jiří Činčura
 Independent IT Specialist


 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is
 your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
Yeah, but it’s different path. The InternalConfiguration class might or might 
not like that (now or in the future). It’s problem waiting to happen.

And please stop sending HTML emails.

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
According to this:
http://entityframework.codeplex.com/wikipage?title=Interception
As I understand DbConfiguration.AddInterceptor is for context instance
interceptions.
And DbInterceptors.AddInterceptor is for global-wide interceptions.
I suggest moving registration MigrationsTransactionsInterceptor to the
DbInterceptors (or maybe via AddDependencyResolver(new
SingletonDependencyResolverIDbInterceptor()) as suggested in
documentation: 
http://msdn.microsoft.com/ru-ru/library/system.data.entity.dbconfiguration.addinterceptor(v=vs.113).aspx),
because it is provider-specific crutch.

On Tue, Dec 30, 2014 at 12:15 PM, Jiří Činčura j...@cincura.net wrote:

 Yeah, but it’s different path. The InternalConfiguration class might or might 
 not like that (now or in the future). It’s problem waiting to happen.

 And please stop sending HTML emails.

 --
 Mgr. Jiří Činčura
 Independent IT Specialist

 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Геннадий Забула
One more question, how can I register custom implementation of
IFbMigrationSqlGeneratorBehavior?

On Tue, Dec 30, 2014 at 12:55 PM, Геннадий Забула zabulu...@gmail.com wrote:
 According to this:
 http://entityframework.codeplex.com/wikipage?title=Interception
 As I understand DbConfiguration.AddInterceptor is for context instance
 interceptions.
 And DbInterceptors.AddInterceptor is for global-wide interceptions.
 I suggest moving registration MigrationsTransactionsInterceptor to the
 DbInterceptors (or maybe via AddDependencyResolver(new
 SingletonDependencyResolverIDbInterceptor()) as suggested in
 documentation: 
 http://msdn.microsoft.com/ru-ru/library/system.data.entity.dbconfiguration.addinterceptor(v=vs.113).aspx),
 because it is provider-specific crutch.

 On Tue, Dec 30, 2014 at 12:15 PM, Jiří Činčura j...@cincura.net wrote:

 Yeah, but it’s different path. The InternalConfiguration class might or 
 might not like that (now or in the future). It’s problem waiting to happen.

 And please stop sending HTML emails.

 --
 Mgr. Jiří Činčura
 Independent IT Specialist

 --
 Dive into the World of Parallel Programming! The Go Parallel Website,
 sponsored by Intel and developed in partnership with Slashdot Media, is your
 hub for all things parallel software development, from weekly thought
 leadership blogs to news, videos, case studies, tutorials and more. Take a
 look and join the conversation now. http://goparallel.sourceforge.net
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
 or maybe via AddDependencyResolver(new
 SingletonDependencyResolverIDbInterceptor()) as suggested in
 documentation: http://msdn.microsoft.com/ru-
 ru/library/system.data.entity.dbconfiguration.addinterceptor(v=vs.113).asp
 x),

I'd like to do this. But when I register it in provider services, it does not 
work. Not sure why.

-- 
Mgr. Jiří Činčura
Independent IT Specialist


--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
 One more question, how can I register custom implementation of
 IFbMigrationSqlGeneratorBehavior?

Register MigrationSqlGenerator with FbMigrationSqlGenerator and pass the 
implementation to ctor. Something like:
AddDependencyResolver(new 
SingletonDependencyResolverFuncMigrationSqlGenerator(() = new 
FbMigrationSqlGenerator(...

EF does not allow to plug custom services. :(

-- 
Mgr. Jiří Činčura
Independent IT Specialist


--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-30 Thread Jiří Činčura
 I'd like to do this. But when I register it in provider services, it does
 not work. Not sure why.

Ahh. Finally found it. IdbInterceptors are not supported for registration in 
DbProviderServices. So we're probably left with only DbInterception.Add. I did 
some research and looks it should work fine. Better than forcing people to 
derive from custom class, I think.

-- 
Mgr. Jiří Činčura
Independent IT Specialist


--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-29 Thread Геннадий Забула
Here are my issues/suggestions:
1. Generator ID. One for all is bad options for me. I'll reimplement it to
have one for table.
2. Couple of errors in creating Constraints or Indexes:
unsuccessful metadata update
Name longer than database column size
Constraint names are longer than it can be in system tables: ALTER TABLE
ClientGroupAlerts ADD CONSTRAINT
FK_ClientGroupAlerts_ClientGroups_ClientGroup_Id. I've figured that
maximum name is 31 (!!!) characters. I've implemented SHA1 (maybe I will
replace it with something faster) hashing of string names.

Will write about further progress.

2014-12-20 8:32 GMT+02:00 Mercea Paul paul.mer...@almexa.ro:

 On 2014.11.06 3:06 PM, Jiří Činčura wrote:
  Hi *,
 
  Anybody here willing to give EF Migrations a try? I'm getting close to
 first implementation.
 
 I'm trying to add support for Firebird db for existing app on SQL
 Express, and, first run of the application was with no errors and
 created the database.
 I'll going to try migrations steps and give feedback.

 Thanks Jiri

 Paul MERCEA
 ___
 E-mail: paul.mer...@almexa.ro
 ___



 --
 Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
 from Actuate! Instantly Supercharge Your Business Reports and Dashboards
 with Interactivity, Sharing, Native Excel Exports, App Integration  more
 Get technology previously reserved for billion-dollar corporations, FREE

 http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-12-19 Thread Mercea Paul
On 2014.11.06 3:06 PM, Jiří Činčura wrote:
 Hi *,

 Anybody here willing to give EF Migrations a try? I'm getting close to first 
 implementation.

I'm trying to add support for Firebird db for existing app on SQL 
Express, and, first run of the application was with no errors and 
created the database.
I'll going to try migrations steps and give feedback.

Thanks Jiri

Paul MERCEA
___
E-mail: paul.mer...@almexa.ro
___


--
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration  more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-13 Thread Jiří Činčura
Except for identity generation should be done: http://ge.tt/3OSvoR42 .

Some feedback?

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-13 Thread Геннадий Забула
Don't have enough time to merge and test it. I look forward to test it and
write some feedback on next week.

2014-11-13 18:31 GMT+02:00 Jiří Činčura j...@cincura.net:

 Except for identity generation should be done: http://ge.tt/3OSvoR42 .

 Some feedback?

 --
 Mgr. Jiří Činčura
 Independent IT Specialist


 --
 Comprehensive Server Monitoring with Site24x7.
 Monitor 10 servers for $9/Month.
 Get alerted through email, SMS, voice calls or mobile push notifications.
 Take corrective actions from your mobile device.

 http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-11 Thread Jiří Činčura
And BTW does anybody has some detailed information about Although this form of 
EXECUTE STATEMENT can also be used with all kinds of DDL strings (except 
CREATE/DROP DATABASE), it is generally very, very unwise to use this trick in 
order to circumvent the no-DDL rule in PSQL., which I'm using to drop NOT NULL 
constraint? I know it's generally wrong, but any problems on engine's side?

-- 
Mgr. Jiří Činčura
Independent IT Specialist
--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-10 Thread Jiří Činčura
So anybody tested migrations?

-- 
Mgr. Jiří Činčura
Independent IT Specialist

--
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111iu=/4140/ostg.clktrk
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-09 Thread Геннадий Забула
I've asked about mutual exclusive of schemes.
If schemes can be applied in one model you can use custom attributes on
primary keys.
If schemes are mutual exclusive, you can use custom extension method for
model builder.

2014-11-09 13:12 GMT+02:00 Jiří Činčura j...@cincura.net:

  The update script should not be changed by users generated by migration.
 Or maybe I don't know something?

 Not exactly. There's assumption that the script will not be mostly
 changed. But some DBA in some classic environments might change it.

  We need to inject some implementation through dependency injection, or
 make it configurable. EF have some built-in dependency injector. Does
 community schemes mentioned above are mutual exclusive for database
 instance?

 Exactly. I'm currently planning to investigate whether EF allows adding
 3rd party services/interfaces to be resolved. And how clean that looks
 like. Maybe after nailing the SQL generation.

 --
 Mgr. Jiří Činčura
 Independent IT Specialist

 --
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-08 Thread Jiří Činčura
Great. Here's http://ge.tt/2Cx9f142?c  early implementation. There are two 
issues which I'm not sure how to do (see below). Rest should work. But there 
might be some missing space etc. in generated SQL or I might wrote it in 
different engine's dialect. That's what I'm mostly looking for for this 
testing. 

For easiest testing is enough to install EntityFramework.Firebird package and 
then replace EntityFramework.Firebird.dll reference with the one from above 
link. The class is FbMigrationSqlGenerator, if you'd like to try it manually.

Issues:
1. Not easy to drop NOT NULL constraint in alter table. I can do it with 
execute block and generate it there, but seems pretty ugly. I wish Firebird 3 
was here.
2. Generating identity columns. It's not directly supported in Firebird. I 
can at least generate #PK_GEN# comment. But I'd like to offer some warning at 
least that you need to create your own trigger and use/create generator. Maybe 
some developer-provided factory to create/alter the trigger and create/use 
generator would work. I'm open for ideas.

-- 
Mgr. Jiří Činčura
Independent IT Specialist
--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-08 Thread Геннадий Забула
Can you provide it on github, so I can patch my copy of FB library to use
in our project?

1. What problem in Execute block?
2. My opinion for Identity is to copy MSSQL behavior. Create generator
for each primary key + trigger before insert.


2014-11-08 14:38 GMT+02:00 Jiří Činčura j...@cincura.net:

 Great. Here's http://ge.tt/2Cx9f142?c  early implementation. There are
 two issues which I'm not sure how to do (see below). Rest should work. But
 there might be some missing space etc. in generated SQL or I might wrote it
 in different engine's dialect. That's what I'm mostly looking for for this
 testing.

 For easiest testing is enough to install EntityFramework.Firebird package
 and then replace EntityFramework.Firebird.dll reference with the one from
 above link. The class is FbMigrationSqlGenerator, if you'd like to try it
 manually.

 Issues:
 1. Not easy to drop NOT NULL constraint in alter table. I can do it with
 execute block and generate it there, but seems pretty ugly. I wish
 Firebird 3 was here.
 2. Generating identity columns. It's not directly supported in Firebird.
 I can at least generate #PK_GEN# comment. But I'd like to offer some
 warning at least that you need to create your own trigger and use/create
 generator. Maybe some developer-provided factory to create/alter the
 trigger and create/use generator would work. I'm open for ideas.

 --
 Mgr. Jiří Činčura
 Independent IT Specialist

 --
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-08 Thread Jiří Činčura
 1. What problem in Execute block?

It kind of breaks the notion of altering the table/column with one command. 
It's a bit of magic with system tables and people might get confused or break 
it by chaning the script.

 2. My opinion for Identity is to copy MSSQL behavior. Create generator for 
 each primary key + trigger before insert.

MSSQL has identities. Given that there are at least two widely used schemes in 
Firebird community and nothing is in the engine itself, I'd like to keep this 
open, with some default implementation.

-- 
Mgr. Jiří Činčura
Independent IT Specialist


--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-06 Thread Геннадий Забула
Sure, waiting for this.

2014-11-06 15:06 GMT+02:00 Jiří Činčura j...@cincura.net:

 Hi *,

 Anybody here willing to give EF Migrations a try? I'm getting close to
 first implementation.

 --
 Mgr. Jiří Činčura
 Independent IT Specialist


 --
 ___
 Firebird-net-provider mailing list
 Firebird-net-provider@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] EF Migrations

2014-11-06 Thread Mercea Paul
On 2014.11.06 3:06 PM, Jiří Činčura wrote:
 Hi *,

 Anybody here willing to give EF Migrations a try? I'm getting close to first 
 implementation.

I'm in.


Paul MERCEA
___


--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider