You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64-6Lines changed: 64 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,12 @@
2
2
3
3
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/activerecord/duckdb/adapter`. To experiment with that code, run `bin/console` for an interactive prompt.
4
4
5
-
TODO: Delete this and the text above, and describe your gem
5
+
6
+
## Overview
7
+
8
+
DuckDB is an embeddable SQL OLAP database used analytical workloads, data science applications, and situations where you need fast analytical queries without the overhead of a separate database server. This adapter allows you to use DuckDB with ActiveRecord and Rails applications.
9
+
10
+
The adapter now defaults to **file-based databases** for data persistence, while still supporting in-memory databases as well.
6
11
7
12
## Installation
8
13
@@ -20,24 +25,77 @@ Or install it yourself as:
20
25
21
26
$ gem install activerecord-duckdb-adapter
22
27
28
+
## Dependencies
29
+
30
+
This adapter depends on:
31
+
-[ruby-duckdb](https://github.com/suketa/ruby-duckdb) - Ruby bindings for DuckDB
32
+
- ActiveRecord 7.0+
33
+
23
34
## Usage
24
35
25
-
TODO: Write usage instructions here
36
+
### Basic Configuration
37
+
38
+
In your `database.yml`:
39
+
40
+
```yaml
41
+
development:
42
+
adapter: duckdb
43
+
# File-based database (default)
44
+
database: db/development.duckdb
45
+
46
+
# For in-memory database (useful for testing)
47
+
# database: ":memory:"
48
+
```
49
+
50
+
### Establishing Connection
51
+
52
+
```ruby
53
+
ActiveRecord::Base.establish_connection(
54
+
adapter:'duckdb',
55
+
database:'db/my_app.duckdb'# or ':memory:' for in-memory database
56
+
)
57
+
```
58
+
26
59
27
60
## Development
28
61
29
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
62
+
After checking out the repo, run:
63
+
64
+
```bash
65
+
bin/setup
66
+
```
67
+
68
+
To run the test suite:
69
+
70
+
```bash
71
+
bundle exec rake test
72
+
```
73
+
74
+
75
+
To experiment with the adapter:
76
+
77
+
```bash
78
+
bin/console
79
+
```
80
+
81
+
82
+
83
+
## References
84
+
-[ruby-duckdb](https://github.com/suketa/ruby-duckdb): The underlying Ruby DuckDB driver (actively maintained)
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
90
33
91
## Contributing
34
92
35
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/activerecord-duckdb-adapter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/activerecord-duckdb-adapter/blob/master/CODE_OF_CONDUCT.md).
93
+
Bug reports and pull requests are welcome on GitHub at https://github.com/red-data-tools/activerecord-duckdb-adapter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/activerecord-duckdb-adapter/blob/master/CODE_OF_CONDUCT.md).
36
94
37
95
## License
38
96
39
97
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
98
41
99
## Code of Conduct
42
100
43
-
Everyone interacting in the Activerecord::Duckdb::Adapter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/activerecord-duckdb-adapter/blob/master/CODE_OF_CONDUCT.md).
101
+
Everyone interacting in the Activerecord::Duckdb::Adapter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/red-data-tools/activerecord-duckdb-adapter/blob/master/CODE_OF_CONDUCT.md).
0 commit comments