This repository has been archived by the owner. It is now read-only.

Transaction support #12

Open
kalifg opened this Issue Oct 4, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Collaborator

kalifg commented Oct 4, 2012

I've been asked if and when Node-DBI will support transactions a la ZendDb:

http://files.zend.com/help/Zend-Framework/zend.db.html#zend.db.adapter.transactions

It should be easy to do for MySQL, I need to look into the other drivers to see how they handle transactions.

Owner

DrBenton commented Oct 5, 2012

Hi !

Great to see you again :-)
Yes, it would indeed be a nice feature to have ; like you said, we would have to add to each managed driver, but we first need to have Transactions support in our DB libraries :

As you can see, this may not be easy ^_^
A first step could be to add the feature to FelixGe's MySQL library ?

Collaborator

kalifg commented Oct 5, 2012

Good to see you too!

That's a good point. I thought it might be as easy as sending the correct SQL to the database but if the underlaying driver doesn't reuse it's connection that won't work right.

That sounds like a good first step. I will try to take a look at the code this weekend.

On a side note, do you think the is any way to make the DB libraries optional? For instance, we just need node-MySQL at work but every time we install Node-DBI we have to compile the other three as well. Doesn't sound like much but it adds up when doing continuous integration.

I don't know if npm supports some sort of build options or if you had any ideas about it. We could possibly remove them as dependencies and have them passed in at runtime, which would make them easier to mock for testing.

It's probably complicated but it was just a though and I was thinking of trying to do that on my own.

On Oct 5, 2012, at 5:19 AM, Olivier Philippon notifications@github.com wrote:

Hi !

Great to see you again :-)
Yes, it would indeed be a nice feature to have ; like you said, we would have to add to each managed driver, but we first need to have Transactions support in our DB libraries :

FelixGe's node-mysql don't seem to support transactions (they are in the TODO list, though)
Sannis's node-mysql-libmysqlclient don't support them either
We don't have them in sqlite3
...and I don't think we have them in the PostgreSQL library
As you can see, this may not be easy ^_^
A first step could be to add the feature to FelixGe's MySQL library ?


Reply to this email directly or view it on GitHub.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.