Skip to content

Commit 2bc8092

Browse files
committed
Chore: Update README and project metadata
1 parent f58fe3e commit 2bc8092

File tree

2 files changed

+44
-32
lines changed

2 files changed

+44
-32
lines changed

README.md

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
[![Gem Version](https://badge.fury.io/rb/activerecord-crate-adapter.svg)](http://badge.fury.io/rb/activerecord-crate-adapter)
1+
[![Gem version](https://badge.fury.io/rb/activerecord-crate-adapter.svg)](https://rubygems.org/gems/activerecord-crate-adapter)
22
[![Build status](https://github.com/crate/activerecord-crate-adapter/actions/workflows/tests.yml/badge.svg)](https://github.com/crate/activerecord-crate-adapter/actions/workflows/tests.yml)
33
[![Code Climate](https://codeclimate.com/github/crate/activerecord-crate-adapter.png)](https://codeclimate.com/github/crate/activerecord-crate-adapter)
44

5-
The [Crate](http://www.crate.io) adapter for ActiveRecord.
65

6+
## About
77

8+
The Ruby on Rails ActiveRecord adapter for [CrateDB],
9+
using the [crate_ruby] driver with HTTP connectivity.
10+
11+
**Note:** The `activerecord-crate-adapter` currently only works with Rails 4.1.x.
812

9-
## Installation
1013

11-
**Note:** `activerecord-crate-adapter` currently only works with Rails 4.1.x
14+
## Installation
1215

13-
Add this line to your application's Gemfile:
16+
Add this line to your application's `Gemfile`:
1417

1518
gem 'activerecord-crate-adapter'
1619

@@ -31,9 +34,9 @@ When using Rails update your database.yml
3134
host: 127.0.0.1
3235
port: 4200
3336

34-
Crate doesn't come with an autoincrement feature for your model ids. So you need to set
35-
it yourself. One way is to use SecureRandom.uuid, if you think there is a better one,
36-
please add an issue so we can discuss.
37+
CrateDB doesn't come with an autoincrement feature for your model ids. So you need to set
38+
it yourself. One way is to use `SecureRandom.uuid`, if you think there is a better one,
39+
please add an issue, so we can discuss.
3740

3841
class Post < ActiveRecord::Base
3942

@@ -47,10 +50,10 @@ please add an issue so we can discuss.
4750

4851
end
4952

50-
## Special Data Types
53+
## Special data types
5154

5255
### Array
53-
You can simply create Array columns by specifying t.array and passing array_type when you create a migration.
56+
You can simply create Array columns by specifying `t.array` and passing `array_type` when you create a migration.
5457

5558
t.array :tags, array_type: :string
5659
t.array :votes, array_type: :integer
@@ -62,10 +65,10 @@ When you create an object just pass your Array directly
6265
post = Post.where("'fresh' = ANY (tags)")
6366

6467
### Object
65-
Crate allows you to define nested objects. I tried to make it as simply as possible to use and reuse existing AR functionality,
66-
I therefore ask you to reuse the existing serialize functionality. AR#serialize allows you to define your own serialization
67-
mechanism and we simply reuse that for serializing an AR object. To get serialize working simply create a #dump and #load method
68-
on the class that creates a literal statement that is then used in the SQL. Read up more in this [commit}(https://github.com/crate/crate/commit/16a3d4b3f23996a327f91cdacef573f7ba946017).
68+
CrateDB allows you to define nested objects. I tried to make it as simply as possible to use and reuse existing AR functionality,
69+
I therefore ask you to reuse the existing serialize functionality. `AR#serialize` allows you to define your own serialization
70+
mechanism, and we simply reuse that for serializing an AR object. To get serialize working simply create `#dump` and `#load` methods
71+
on the class that creates a literal statement that is then used in the SQL. Read up more in this [commit about array and object literals].
6972

7073
I tried to make your guys life easier and created a module that does this automatically for you. Simply make all attributes accessible
7174
and assign it in the initializer. So a serialized class should look like this:
@@ -86,9 +89,9 @@ and assign it in the initializer. So a serialized class should look like this:
8689

8790
end
8891

89-
Check out CrateObject module if you need to write your own serializer.
92+
Check out the `CrateObject` module if you need to write your own serializer.
9093

91-
Then in your model simply use #serialize to have objects working
94+
Then in your model simply use `#serialize` to have objects working.
9295

9396
class User < ActiveRecord::Base
9497
serialize :address, Address
@@ -98,7 +101,8 @@ Note: I do not plan to support nested objects inside objects.
98101

99102
#### Object Migrations
100103

101-
In the migrations you can create an object and specify the object behaviour(strict|dynamic|ignored) and it's schema.
104+
In the migrations, you can create an object, specify the object behaviour
105+
`(strict|dynamic|ignored)`, and its schema.
102106

103107
t.object :address, object_schema_behaviour: :strict,
104108
object_schema: {street: :string, city: :string, phones: {array: :string}, zip: :integer}
@@ -107,19 +111,19 @@ In the migrations you can create an object and specify the object behaviour(stri
107111

108112
## Migrations
109113

110-
Currently adding and dropping indices is not support by Crate. Issue [#733](https://github.com/crate/crate/issues/733)
114+
Currently, adding and dropping indices is not support by CrateDB, see [issue #733].
111115

112-
# not supported by Crate yet
116+
# not supported by CrateDB yet
113117
add_index :posts, :comment_count
114118
remove_index :posts, :comment_count
115119

116120

117-
## Gotchas
121+
## Caveats
118122

119-
Crate is eventually consistent, that means if you create a record and query for it right away it
120-
won't work (except queries for the primary key!). Read more about it [here](https://github.com/crate/crate/blob/master/docs/sql/dml.txt#L569)
123+
CrateDB is eventually consistent, that means if you create a record, and query
124+
for it right away, it won't work (except queries for the primary key).
121125

122-
Crate does not support Joins (yet) so joins won't work.
126+
In this context, read more about the [`REFRESH TABLE`] statement.
123127

124128
## Tests
125129

@@ -130,13 +134,21 @@ See [DEVELOP.md](DEVELOP.md).
130134

131135
If you think something is missing, either create a pull request
132136
or log a new issue, so someone else can tackle it.
133-
Please refer to CONTRIBUTING.rst for further information.
137+
Please refer to [CONTRIBUTING.rst](CONTRIBUTING.rst) for further information.
138+
139+
## Maintainers
140+
141+
* [Crate.IO GmbH](https://crate.io)
142+
* [Christoph Klocker](http://vedanova.com), [@corck](https://twitter.com/corck)
134143

135-
## Maintainer
144+
## License
136145

137-
* [CRATE Technology GmbH](http://crate.io)
138-
* [Christoph Klocker](http://www.vedanova.com), [@corck](http://www.twitter.com/corck)
146+
This project is licensed under the [Apache License 2.0].
139147

140-
## License & Copyright
141148

142-
[Apache License 2.0](https://github.com/crate/activerecord-crate-adapter/blob/main/LICENSE)
149+
[Apache License 2.0]: https://github.com/crate/activerecord-crate-adapter/blob/master/LICENSE
150+
[commit about array and object literals]: https://github.com/crate/crate/commit/16a3d4b3f2
151+
[CrateDB]: https://github.com/crate/crate
152+
[crate_ruby]: https://github.com/crate/crate_ruby
153+
[issue #733]: https://github.com/crate/crate/issues/733
154+
[`REFRESH TABLE`]: https://crate.io/docs/crate/reference/en/latest/general/dql/refresh.html

activerecord-crate-adapter.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ require 'activerecord-crate-adapter/version'
2626
Gem::Specification.new do |spec|
2727
spec.name = "activerecord-crate-adapter"
2828
spec.version = ActiverecordCrateAdapter::VERSION
29-
spec.authors = ["Christoph Klocker", "CRATE Technology GmbH"]
29+
spec.authors = ["Christoph Klocker", "Crate.IO GmbH"]
3030
spec.email = ["office@crate.io"]
31-
spec.summary = "ActiveRecord adapter for Crate"
32-
spec.description = "ActiveRecord adapter for Crate, the distributed database for Docker."
31+
spec.summary = "ActiveRecord adapter for CrateDB"
32+
spec.description = "ActiveRecord adapter for CrateDB, the distributed SQL database based on Lucene"
3333
spec.homepage = "https://crate.io"
3434
spec.license = "Apache License, v2.0"
3535

0 commit comments

Comments
 (0)