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

Create an Oracle Persistence provider for Even #9

Open
DamianReeves opened this issue Dec 22, 2015 · 6 comments
Open

Create an Oracle Persistence provider for Even #9

DamianReeves opened this issue Dec 22, 2015 · 6 comments
Assignees

Comments

@DamianReeves
Copy link
Collaborator

I'm going to attempt to create an Oracle persistence provider/plugin for Even.

What is the desired model for persistence providers, a separate project, like the Even.MySql project or all in one solution?

@nvivo
Copy link
Member

nvivo commented Dec 23, 2015

I believe it will be easier to have this in a separated project for now.

@nvivo
Copy link
Member

nvivo commented Dec 25, 2015

@DamianReeves

Ho Ho Ho! Take a look at Even.Persistence.Sql I just implemented. You should be able to extend the new BaseSqlStore now. That should make your life much easier to get this started.

@DamianReeves
Copy link
Collaborator Author

Thanks, will take a look.

@DamianReeves
Copy link
Collaborator Author

I like the idea of using the ADO.NET provider model to make the persistence layer easy to use. I have to do some added work since I'm not directly linking in the Oracle binaries.
I'm trying to avoid reflection when dealing with the OracleBlob type needed to store payload and metadata, so I'm looking at using System.Expression to access provider specific types directly from the provider agnostic Even.Persistence.Sql project.

@nvivo
Copy link
Member

nvivo commented Jan 5, 2016

I never used oracle, so I don't know exactly the differences in the provider space, but I don't think it would be bad to reference ODP directly. The reason I created a single project for SQL and MySQL is because 1) I'm lazy and I didn't want to have to publish multiple packages, and 2) because mostly they work the same using only the abstract System.Data classes.

But this is not something I'm content with. To detect duplicate key violations with mysql, I'm checking for the exception message instead of the error code which could be done if I had access to the MySqlException class.

So, I wouldn't be afraid of creating a dedicated package and depending directly on the oracle provider. I think we need to test some concepts, it's too soon to settle on a format for these things.

@DamianReeves
Copy link
Collaborator Author

Sometime today or tomorrow I'll push up changes to my fork, some code might help you see what's involved.
Overall though a common thing is cases where you need a provider specific DbType enum. For instance, in Oracle I need a blob column since varbinary doesn't exist and DbType.Binary doesn't properly map to blob.

@DamianReeves DamianReeves self-assigned this Jan 15, 2016
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

2 participants