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

Support ODBC driver #31

Open
DaveSanders opened this issue Jan 30, 2014 · 8 comments
Open

Support ODBC driver #31

DaveSanders opened this issue Jan 30, 2014 · 8 comments

Comments

@DaveSanders
Copy link

I can't say I'm surprised, but upsert doesn't suport ODBC::Database driver. Just so happens for this one client I need to upsert to a ODBC (MSSQL) database.

If someone were to give me a clue where to start, I might be able to help here. But I haven't had a chance to go dig through the code to figure out whats needed.

I suspect its not an itch that many people need to scratch. But I figured I'd log it.

@seamusabshere
Copy link
Owner

hey @DaveSanders, a good place to start is to provide a working example of upsert in MSSQL.

  1. (best) do it with SQL MERGE since MSSQL seems to support that
  2. (better) write a database function that takes the same inputs as the postgres upsert function and the mysql upsert function
  3. (worst) do it with something like INSERT OR IGNORE + UPDATE as in the sqlite3 upsert function

if you provide the SQL and a narrative of how it works, I can help wrap it in Ruby to be part of this gem.

@DaveSanders
Copy link
Author

Excellent. We'll figure it out and get back to you.

@DaveSanders
Copy link
Author

Ok, here's a working merge example in MSSQL: https://gist.github.com/DaveSanders/8721734

@seamusabshere
Copy link
Owner

hey @pnomolos , would you have time to create the requisite files

  1. lib/upsert/column_definition/mssql.rb
  2. lib/upsert/connection/ODBC_Database_MSSQL.rb (not sure what the exact class name is)
  3. lib/upsert/merge_function/ODBC_Database_MSSQL.rb (ditto)
  4. lib/upsert/merge_function/mssql.rb

then perhaps @DaveSanders can help fill them out?

(sorry for huge delay in responding, I've been swamped at work)

@pnomolos
Copy link
Collaborator

Hey @seamusabshere and @DaveSanders sorry for the big delay - do you still need me to take a look at this?

@seamusabshere
Copy link
Owner

hey @pnomolos that would be great!

@seamusabshere
Copy link
Owner

hi @pnomolos it's me again ;)

given my comment above listing files needing to get created, would you have time to kickstart this?

@pnomolos
Copy link
Collaborator

pnomolos commented May 2, 2014

I'll see what I can do to get this done - or at least started - over the weekend :)

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

3 participants