flounder 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/flounder.gemspec +1 -1
- data/lib/flounder/domain.rb +3 -0
- data/lib/flounder/query/base.rb +17 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bebf705b64f42741d7a218d8a8deec495228b9b3
|
4
|
+
data.tar.gz: f11eba4e515486212a345b17a845cdfa9b1c1cf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 149d35c4af68907002233dda0c2aa9708852aced08a97fa13604d99974479347a1034434e48073d90c5a27bcb0847d87524809bab3c9403eedc199482cb30310
|
7
|
+
data.tar.gz: e30b31d789d5af1243faf3e4fdbe7f33944fe95ae30f29ce252c8d95d8d2c8d1a7829859a683e9ad3a4ff64008871ff64fffae7f5f873072a59298f2f9711142
|
data/flounder.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "flounder"
|
5
|
-
s.version = '0.11.
|
5
|
+
s.version = '0.11.1'
|
6
6
|
s.summary = "Flounder is a way to write SQL simply in Ruby. It deals with everything BUT object relational mapping. "
|
7
7
|
s.email = "kaspar.schiess@technologyastronauts.ch"
|
8
8
|
s.homepage = "https://bitbucket.org/technologyastronauts/oss_flounder"
|
data/lib/flounder/domain.rb
CHANGED
data/lib/flounder/query/base.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
|
2
|
+
require 'benchmark'
|
3
|
+
|
2
4
|
module Flounder::Query
|
3
5
|
class Base
|
4
6
|
def initialize domain, manager_klass, entity
|
@@ -53,13 +55,15 @@ module Flounder::Query
|
|
53
55
|
def kick connection=nil
|
54
56
|
all = nil
|
55
57
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
58
|
+
measure do
|
59
|
+
(connection || engine).exec(self.to_sql, bind_values) do |result|
|
60
|
+
all = Array.new(result.ntuples, nil)
|
61
|
+
result.ntuples.times do |row_idx|
|
62
|
+
all[row_idx] = engine.connection.
|
63
|
+
objectify_result_row(entity, result, row_idx) do |name|
|
64
|
+
column_name_to_entity(name)
|
65
|
+
end
|
66
|
+
end
|
63
67
|
end
|
64
68
|
end
|
65
69
|
|
@@ -69,6 +73,12 @@ module Flounder::Query
|
|
69
73
|
# Implement this if your column names in the query allow inferring
|
70
74
|
# the entity and the column name. Return them as a tuple <entity, name>.
|
71
75
|
end
|
76
|
+
def measure
|
77
|
+
measure = Benchmark.measure {
|
78
|
+
yield
|
79
|
+
}
|
80
|
+
domain.log_bm measure
|
81
|
+
end
|
72
82
|
|
73
83
|
private
|
74
84
|
# Prepares a kick - meaning an execution on the database or a transform
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flounder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kaspar Schiess
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: arel
|