Writing a driver is not easy, but as a rule, itβs best to look at several other drivers, break them into the necessary items, and create a backup by filling in the blanks.
ActiveRecord comes with Postgres, MySQL, SQLite3, and SQLite adapters, so you can write your own using them as examples. They are in lib/active_record/connection_adaptersand they are all based on a common abstract adapter.
You may have trouble trying to write a wrapper for a non-SQL database, where ActiveRecord offers many suggestions about what tools have a basic storage engine.
source
share