https://github.com/henrytseng/activerecord-materialize-adapter
ActiveRecord Materialize.io database adapter based on Postgres adapter
https://github.com/henrytseng/activerecord-materialize-adapter
activerecord beta materialize rails ruby
Last synced: 6 months ago
JSON representation
ActiveRecord Materialize.io database adapter based on Postgres adapter
- Host: GitHub
- URL: https://github.com/henrytseng/activerecord-materialize-adapter
- Owner: henrytseng
- License: mit
- Created: 2021-07-09T14:13:58.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-05-05T19:42:16.000Z (almost 4 years ago)
- Last Synced: 2025-04-11T16:36:47.713Z (about 1 year ago)
- Topics: activerecord, beta, materialize, rails, ruby
- Language: Ruby
- Homepage:
- Size: 165 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# ActiveRecord Materialize Adapter
[](https://github.com/henrytseng/activerecord-materialize-adapter/actions/workflows/testing.yml)
[](https://materialize.com/docs)
[](https://materialize.com/s/chat)
An ActiveRecord adapter to connect to Materialize databases. The adapter includes support for materialized views as models supported by `ActiveRecord::Base`. Support for typical relational database tables are also supported but secondary.
Materialize is a streaming database for real-time applications. Materialize accepts input data from a variety of streaming sources (e.g. Kafka) and files (e.g. CSVs), and lets you query them using SQL.
[https://materialize.com/](https://materialize.com/)
## Usage
Add gem to your `Gemfile`
```
gem 'activerecord-materialize-adapter'
```
Make sure you have the `pg` or a compatible gem installed. Update your `database.yml`
```
production:
reporting_analytics:
adapter: materialize
host: "materialize-database-host"
port: "6875"
database: "materialize_database_name"
username: "materialize_user"
```
*Gem is currently in an alpha state originally designed as a proof-of-concept.*
## Design
The ActiveRecord Materialize Adapter is heavily based on the PostgreSQL database adapter and also relies on the `pg` gem to be installed.
Read about Materialized architecture [https://materialize.com/docs/overview/architecture/](https://materialize.com/docs/overview/architecture/)
Materialize has been designed to specifically solve problems with event streaming; therefore, some relational database functionality may not be supported.
## Contributing
To contribute read the `CONTRIBUTING.md` first.
Fork the repository and create a pull request referencing tests and documentation.
A development stack can be setup with `bin/build` and tests can be run with `bin/test`.
Debugging with `bin/materialize_psql` and `bin/psql` allows you to connect directly with Materialize and PostgreSQL.
For testing and debugging a PostgreSQL configuration is available in `postgres/postgresql.conf` and `pg_hba.conf`.