rails_elastic_sensitivity 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -6
- data/lib/rails_elastic_sensitivity.rb +0 -1
- data/lib/rails_elastic_sensitivity/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e097b29769d8ed9e5ef84706d4ad17de585f6ed89ef1d5f7dcaf3d31bb8d8deb
|
4
|
+
data.tar.gz: 9bdef083dc6219807c906e42f44294ce37dcde7bd2c6651e8ee13bd08e4be12d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e72e060e807cf9ed015e366fcfcfef2268de558063fa6dfd370211480717ae53e7d803890df0e050f6e9aacad03cbb28d46c762ecd7116efce01514a9f4b36ad
|
7
|
+
data.tar.gz: 6bfe349288aa309409e9f727dcc8eecf7e233056d1fa083ca00a35f0484e27ba88a39610d5c50032cca16409b95c72861c0cf78a4960e44dd2f383b59fa05235
|
data/README.md
CHANGED
@@ -1,20 +1,25 @@
|
|
1
|
-
|
1
|
+
## What is Rails Elastic Sensitivity?
|
2
2
|
|
3
|
-
|
3
|
+
Elastic sensitivity is an approach which was invented by UBER for efficiently approximating the local sensitivity of a query, which can be used to
|
4
|
+
enforce differential privacy for the query. The approach requires only a static analysis of the query and therefore
|
5
|
+
imposes minimal performance overhead. Importantly, it does not require any changes to the database.
|
6
|
+
Details of the approach are available in [this paper](https://arxiv.org/abs/1706.09479).
|
7
|
+
|
8
|
+
This Project implement this mechanism on Rails to achieve counting query with any DataBase Rails support (MySQL, PostSQL, SQLite, etc).
|
4
9
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
10
|
|
7
11
|
## Installation
|
8
12
|
|
9
13
|
Add this line to your application's Gemfile:
|
10
14
|
|
11
15
|
```ruby
|
12
|
-
|
16
|
+
# Lastest Version
|
17
|
+
gem 'rails_elastic_sensitivity', '~> 0.1.1'
|
13
18
|
```
|
14
19
|
|
15
20
|
And then execute:
|
16
21
|
|
17
|
-
$ bundle
|
22
|
+
$ bundle install
|
18
23
|
|
19
24
|
Or install it yourself as:
|
20
25
|
|
@@ -22,7 +27,7 @@ Or install it yourself as:
|
|
22
27
|
|
23
28
|
## Usage
|
24
29
|
|
25
|
-
Example:
|
30
|
+
Single Join Example:
|
26
31
|
|
27
32
|
```rb
|
28
33
|
# Create Instance
|
@@ -35,6 +40,13 @@ es.joins(:gamecharacters).where(gamecharacters: {course_id: 100}).count
|
|
35
40
|
es.joins(:gamecharacters).where(gamecharacters: {course_id: 100}).elastic_count
|
36
41
|
```
|
37
42
|
|
43
|
+
Double Join Example:
|
44
|
+
```rb
|
45
|
+
es = ElaticSensitivity.new(:user)
|
46
|
+
es.joins(gamecharacters: :gc_achievements).where(gamecharacters: {course_id: 1}).count
|
47
|
+
es.joins(gamecharacters: :gc_achievements).where(gamecharacters: {course_id: 1}).elastic_count
|
48
|
+
```
|
49
|
+
|
38
50
|
## Development
|
39
51
|
|
40
52
|
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.
|