SQAC ORM
Sqac is a thin ORM that was written to talk to the SAP Hana in-memory db and other commonly used DBMS systems. The ORM code is simple and can easily be extended to support any database for which a go driver exists.
There are a lot of go-based ORM solutions, so why write a new one?
At the time sqac was written, an ORM solution wasn’t available for the SAP Hana database. I wanted to be able to write an application, test it against a locally installed DBMS like Postgres and then simply ‘re-aim’ the application at SAP Hana without making changes. While it would have been possible to extend an existing ORM solution, I wanted to see what was involved in writing one of my own. Sqac is the result.
Features
- Uses go struct tags backed by a user-accessible API to declare database tables.
- Struct tags support the declaration of simple and compound indices, foreign-key relationships, primary-keys with starting point, default value, nullable etc.
- Supports PostgreSQL, MySQL, Sqlite3, MSSQL & SAP Hana.
- Easily extended to support other DB’s via implementation of the PublicDB interface.
- API supports common DDL requirements (CREATE, DROP, ALTER etc. for table, indices, sequences etc.).
- API supports generic CRUD entity operations.
- Set/Get API commands support (/$count /$orderby=field_name $limit=n; $offset=n; ($asc|$desc)).
- Access to standard go sql and jmoiron’s sqlx API’s.
- A robust test suite is included to ensure correct operation.