postgres_adapter.cr

Postgres adapter for [active_record.cr](https://github.com/waterlink/active_record.cr). Uses [crystal-pg](https://github.com/will/crystal-pg) driver.

postgres_adapter Build Status

Postgres adapter for active_record.cr. Uses crystal-pg driver.

Installation

Add this to your application's shard.yml:

dependencies:
  postgres_adapter:
    github: waterlink/postgres_adapter.cr
    version: ~> 0.4

Usage

require "active_record"
require "postgres_adapter"

class User < ActiveRecord::Model
  adapter postgres
  # ...
end

Providing postgres connection details

Currently it is done through environment variables:

Either PG_URL:

PG_URL=postgres://<user>:<password>@<host>:<port>/<database>?sslmode=<sslmode>

Or by corresponding components:

PG_USER=<user>
PG_PASS=<password>
PG_HOST=<host>
PG_DATABASE=<database>
PG_SSL_MODE=<sslmode>

Development

After cloning run crystal deps or crystal deps update.

Just use normal TDD cycle. To run tests use:

./bin/test

This will run unit test in spec/ and integration spec in integration/.

Contributing

  1. Fork it ( https://github.com/waterlink/postgres_adapter.cr/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

Contributors

  • waterlink Oleksii Fedorov - creator, maintainer
Repository

postgres_adapter.cr

Owner
Statistic
  • 9
  • 9
  • 0
  • 2
  • 3
  • about 7 years ago
  • November 2, 2015
License

MIT License

Links
Synced at

Thu, 02 May 2024 17:26:49 GMT

Languages