recordx_sqlite 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -1
- data.tar.gz.sig +0 -0
- data/lib/recordx_sqlite.rb +9 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbbe96d103bf7b5e6cfa8433184e866d0fff80d0
|
4
|
+
data.tar.gz: 750af1b3bf58f8d14263a7c18413e9e0d9518923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c490b864a9c7579919d991cecb054f1f2ce6b3a026cbe9ab4681e6fbba5cb9e56e9b819f898669e791383cb3dc7f9c5d5e5a85fa45018d776b4e99c6e51fa7c
|
7
|
+
data.tar.gz: a60d3f9444885d0b2504204ae9c9127338dea921305431764f437b40a1e50bafd8393af6147fdbd41106da2e679a9bbaca39c12258a9bc7c094f289e9e3eb9d9
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
|
2
|
+
��ؚH�cxU�56����G�1��S._��hn��������\��n3�����n"l��U{�R��N�������S�kfD7a\���F��Hw�Gww}d�4��sİ������e�P�hq�Gn\�E3D}����+o �ڸh��']���g�x�y�)7��4���a�QH�)��L7�u!���봐l�}��wH�8G�aD]�X�c�Q*S���P�3`�{�i:9IwW�����Y�CQ�ost�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/recordx_sqlite.rb
CHANGED
@@ -9,7 +9,7 @@ require 'recordx'
|
|
9
9
|
class RecordxSqlite
|
10
10
|
|
11
11
|
def initialize(dbfile, table: '', primary_key: :id, pk: primary_key,
|
12
|
-
sql: nil)
|
12
|
+
sql: nil, pagesize: 10)
|
13
13
|
|
14
14
|
@db = SQLite3::Database.new dbfile
|
15
15
|
|
@@ -31,7 +31,7 @@ class RecordxSqlite
|
|
31
31
|
|
32
32
|
@sql = sql || 'select * from ' + @table.to_s
|
33
33
|
@default_sql = @sql
|
34
|
-
|
34
|
+
@pagesize = pagesize
|
35
35
|
@a = nil
|
36
36
|
|
37
37
|
end
|
@@ -83,6 +83,13 @@ class RecordxSqlite
|
|
83
83
|
@sql += " ORDER BY #{@primary_key} #{dir.to_s.upcase}"
|
84
84
|
self
|
85
85
|
end
|
86
|
+
|
87
|
+
def page(n=1)
|
88
|
+
|
89
|
+
query(@sql + " ORDER BY %s DESC LIMIT %s OFFSET %s" %
|
90
|
+
[@primary_key, @pagesize, @pagesize*(n-1)], cache: false)
|
91
|
+
|
92
|
+
end
|
86
93
|
|
87
94
|
def query(sql=@sql, cache: true)
|
88
95
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: recordx_sqlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
pewreBQ0QCPuPbV1FPlyX5N5qsGIMHFIYqUlaykOA8156Y6fbIbqQsLwxaSr8WkD
|
32
32
|
eojajR/fTTvliw==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2017-07-
|
34
|
+
date: 2017-07-04 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: sqlite3
|
metadata.gz.sig
CHANGED
Binary file
|