enrichment_db 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/enrichment_db.rb +11 -0
- data/lib/enrichment_db/datum.rb +0 -10
- data/lib/enrichment_db/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ced6e9cc62c6dd68ec83db0abe2684b6c3c4535a
|
4
|
+
data.tar.gz: 0f1fcffaef04c8d30c74f73892b0893379ada295
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aac6db9cd446762db07c085673c20d3953995c09c749dfaa8829061440b5ac6a1ed30dd25379f719712e80b0bb6c70dec5822d28128f6aeca9cd46e61948b490
|
7
|
+
data.tar.gz: 07e674766a38fb0f94344f0e8400e745a79a0823fe2b198a8c9ec20a2f764eb94856c6a3495d726010bc64ebe1104fa496ef6ba7bed4499a6c4ac7dd0eef89a0
|
data/lib/enrichment_db.rb
CHANGED
@@ -38,6 +38,17 @@ module EnrichmentDb
|
|
38
38
|
|
39
39
|
format_result(result)
|
40
40
|
end
|
41
|
+
|
42
|
+
def self.by_lambda(schema_name, table_name, condition)
|
43
|
+
puts "Finding object from #{table_name} with condition #{condition}."
|
44
|
+
query = "SELECT * FROM #{schema_name}.#{table_name} where #{condition}"
|
45
|
+
|
46
|
+
result = EnrichmentDb.request(schema_name, query).collect do |record|
|
47
|
+
record
|
48
|
+
end
|
49
|
+
|
50
|
+
format_result(result)
|
51
|
+
end
|
41
52
|
|
42
53
|
def self.all(table_name, schema_name = nil)
|
43
54
|
schema_name = schema_name || self::DATABASE_NAME
|
data/lib/enrichment_db/datum.rb
CHANGED
@@ -1,14 +1,4 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
3
|
class EnrichmentDb::Datum < EnrichmentDb::DatumModel
|
4
|
-
def self.by_lambda(schema_name, table_name, condition)
|
5
|
-
puts "Finding object from #{table_name} with condition #{condition}."
|
6
|
-
query = "SELECT * FROM #{schema_name}.#{table_name} where #{condition}"
|
7
|
-
|
8
|
-
result = EnrichmentDb.request(schema_name, query).collect do |record|
|
9
|
-
record
|
10
|
-
end
|
11
|
-
|
12
|
-
format_result(result)
|
13
|
-
end
|
14
4
|
end
|