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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bea30fa0ae7d919dc8589e30330249ea6e095aa7
4
- data.tar.gz: 63f42ad1e7a55ca312af2de5c5617f1570c19810
3
+ metadata.gz: cbbe96d103bf7b5e6cfa8433184e866d0fff80d0
4
+ data.tar.gz: 750af1b3bf58f8d14263a7c18413e9e0d9518923
5
5
  SHA512:
6
- metadata.gz: f0b83a05495a1fa7ed4d1fd89967f25a20337f90dde0931b93bd15e91e629a8955f227e77d661c7c31e41ccb786fab3e34c61b7f109d3d4a7893a6c17738d903
7
- data.tar.gz: 6ad6164c430baebe6397357b71fc9c4e2108f4dc86f2a1fc9c026a373eec11e25cd840837b1aad770e0b14bb7678721999d17f4af5c51edde69ac3ae0dca1729
6
+ metadata.gz: 2c490b864a9c7579919d991cecb054f1f2ce6b3a026cbe9ab4681e6fbba5cb9e56e9b819f898669e791383cb3dc7f9c5d5e5a85fa45018d776b4e99c6e51fa7c
7
+ data.tar.gz: a60d3f9444885d0b2504204ae9c9127338dea921305431764f437b40a1e50bafd8393af6147fdbd41106da2e679a9bbaca39c12258a9bc7c094f289e9e3eb9d9
@@ -1 +1,2 @@
1
- ������h%a/���UE�%y#�:2���II��,ngx��5�dXي�_Z��,yJ��GR�)g�+= �DbMI�uq�pU�ժ�
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
@@ -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.6
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-02 00:00:00.000000000 Z
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