ruby - How to pull data from remote server database in rails? -


i using tiny_tds connecting remote database, used mysql , sql server. other gem available can access vendor database?

you're not understanding how database access works.

we use driver talk database. database vendors have different protocols used connect, driver handles that.

above layer we'd have api talks driver. that'd dbi, knows how talk different drivers. still have write using query language of database dbi gives advantages. it's pain convert 1 database another, because queries change , inconsistencies between "standards" show up.

above layer we'd have activerecord or sequel, orms, , dbm agnostic. allow use consistent language define our connections databases, create queries , handle interactions. if want talk different database manager, install driver, change connection string, , rest should work.

this huge time savings , "very thing". can use sqlite proof-of-concepts, , postgresql, mysql, or oracle production system, without changing queries. dsn/connection string changes usually.

read through sequel's "connecting database" document idea orms can do, along "sequel: database toolkit ruby" , "cheat sheet" idea sequel can do.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -