All Projects → amberframework → Granite

amberframework / Granite

Licence: mit
ORM Model with Adapters for mysql, pg, sqlite in the Crystal Language.

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to Granite

Go Sqlbuilder
A flexible and powerful SQL string builder library plus a zero-config ORM.
Stars: ✭ 539 (+126.47%)
Mutual labels:  sql, orm, database, mysql
Nut
Advanced, Powerful and easy to use ORM for Qt
Stars: ✭ 181 (-23.95%)
Mutual labels:  sql, orm, database, mysql
Db
Data access layer for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.
Stars: ✭ 2,832 (+1089.92%)
Mutual labels:  sql, orm, database, mysql
Rel
💎 Modern Database Access Layer for Golang - Testable, Extendable and Crafted Into a Clean and Elegant API
Stars: ✭ 317 (+33.19%)
Mutual labels:  sql, orm, database, mysql
Jooq
jOOQ is the best way to write SQL in Java
Stars: ✭ 4,695 (+1872.69%)
Mutual labels:  sql, orm, database, mysql
Gnorm
A database-first code generator for any language
Stars: ✭ 415 (+74.37%)
Mutual labels:  sql, orm, database, mysql
Linq2db
Linq to database provider.
Stars: ✭ 2,211 (+828.99%)
Mutual labels:  sql, orm, database, mysql
Qb
The database toolkit for go
Stars: ✭ 524 (+120.17%)
Mutual labels:  sql, orm, database, mysql
Ebean
Ebean ORM
Stars: ✭ 1,172 (+392.44%)
Mutual labels:  sql, orm, database, mysql
Liquibase
Main Liquibase Source
Stars: ✭ 2,910 (+1122.69%)
Mutual labels:  sql, database, mysql
Ohmysql
Easy direct access to your database 🎯 http://oleghnidets.github.io/OHMySQL/
Stars: ✭ 166 (-30.25%)
Mutual labels:  sql, database, mysql
Scany
Library for scanning data from a database into Go structs and more
Stars: ✭ 228 (-4.2%)
Mutual labels:  sql, database, mysql
Sqlservice
The missing SQLAlchemy ORM interface.
Stars: ✭ 159 (-33.19%)
Mutual labels:  sql, orm, database
Pomelo.entityframeworkcore.mysql
Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector
Stars: ✭ 2,099 (+781.93%)
Mutual labels:  orm, database, mysql
Myproxy
A sharding proxy for MYSQL databases
Stars: ✭ 153 (-35.71%)
Mutual labels:  sql, database, mysql
Norm
Access a database in one line of code.
Stars: ✭ 152 (-36.13%)
Mutual labels:  sql, orm, database
Sqlcheck
Automatically identify anti-patterns in SQL queries
Stars: ✭ 2,062 (+766.39%)
Mutual labels:  sql, database, mysql
Stackoverflow Clone
Clone project of a famous Q/A website for developers which is stackoverflow built using MySQL-Express-React-Node 🌐
Stars: ✭ 182 (-23.53%)
Mutual labels:  sql, database, mysql
Migrate
Database migrations. CLI and Golang library.
Stars: ✭ 2,315 (+872.69%)
Mutual labels:  sql, database, mysql
Simple Crud
PHP library to provide magic CRUD in MySQL/Sqlite databases with zero configuration
Stars: ✭ 190 (-20.17%)
Mutual labels:  orm, database, mysql

Granite

Amber is a web framework written in the Crystal language.

This project is to provide an ORM in Crystal.

Build Status

Documentation

Documentation

Contributing

  1. Fork it ( https://github.com/amberframework/granite/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Running tests

Granite uses Crystal's built in test framework. The tests can be run with $ crystal spec.

The test suite depends on access to a PostgreSQL, MySQL, and SQLite database to ensure the adapters work as intended.

Docker setup

There is a self-contained testing environment provided via the docker-compose.yml file in this repository. We are testing against multiple databases so you have to specify which docker-compose file you would like to use. Replace "{database_type}" with "mysql" or "pg" or "sqlite". Before you can run the docker configuration you have to set the appropriate env variables. To do so you can either load them yourself or modify the .env file that docker-compose loads by default.

You can find postgres versions at https://hub.docker.com/_/postgres/ You can find mysql versions at https://hub.docker.com/_/mysql/

After you have docker installed do the following to run tests:

First run

$ docker-compose -f docker/docker-compose.{database_type}.yml build spec
$ docker-compose -f docker/docker-compose.{database_type}.yml run spec

Subsequent runs

$ docker-compose -f docker/docker-compose.{database_type}.yml run spec

Cleanup

If you're done testing and you'd like to shut down and clean up the docker dependences run the following:

$ docker-compose -f docker/docker-compose.{database_type}.yml down

Run all

To run the specs for each database adapter use ./spec/run_all_specs.sh. This will build and run each adapter, then cleanup after itself.

Local setup

If you'd like to test without docker you can do so by following the instructions below:

  1. Install dependencies with $ shards install
  2. Update .env to use appropriate ENV variables, or create appropriate databases.
  3. Setup databases:

PostgreSQL

CREATE USER granite WITH PASSWORD 'password';

CREATE DATABASE granite_db;

GRANT ALL PRIVILEGES ON DATABASE granite_db TO granite;

MySQL

CREATE USER 'granite'@'localhost' IDENTIFIED BY 'password';

CREATE DATABASE granite_db;

GRANT ALL PRIVILEGES ON granite_db.* TO 'granite'@'localhost' WITH GRANT OPTION;
  1. Export .env with $ source .env
  2. $ crystal spec
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].