sequel-pg-trgm 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sequel/extensions/pg_trgm.rb +0 -10
- data/lib/sequel/plugins/pg_trgm.rb +1 -1
- metadata +46 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf9f322859fe86be7c5e55d3a2969fb00c6d5db4
|
4
|
+
data.tar.gz: 9e97487d78860ca00f85002b5c3692e0b7dd8fdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 646ddc315c725dc7d459333e40fb635e35795f7c59ec33d4519d106807f8023f68abc269017da5aadd04aff9de4a6e9b12b83986b3384f9328ba4d381c60b380
|
7
|
+
data.tar.gz: 2a08ae33e26c5e4d4e658d5b758e693bfc39150cb0892efd4c3a733746cfb58a8a24c8c0d66b58e37f0813243e3befc71199adfe7a4b0393b631be310b084745
|
@@ -1,16 +1,6 @@
|
|
1
1
|
module Sequel
|
2
2
|
module Postgres
|
3
3
|
module PgTrgm
|
4
|
-
def add_extension(name)
|
5
|
-
quoted_name = quote_identifier(name) if name
|
6
|
-
self.run "CREATE EXTENSION IF NOT EXISTS #{quoted_name};"
|
7
|
-
end
|
8
|
-
|
9
|
-
def drop_extension(name)
|
10
|
-
quoted_name = quote_identifier(name) if name
|
11
|
-
self.run "DROP EXTENSION IF EXISTS #{quoted_name};"
|
12
|
-
end
|
13
|
-
|
14
4
|
def add_pg_trgm(table, column, op={})
|
15
5
|
self.run "CREATE INDEX #{table}_#{column}_trgm_index ON #{table} USING gist (#{column} gist_trgm_ops);"
|
16
6
|
end
|
@@ -3,7 +3,7 @@ module Sequel
|
|
3
3
|
module PgTrgm
|
4
4
|
module DatasetMethods
|
5
5
|
def text_search(column, query)
|
6
|
-
where("
|
6
|
+
where("? % ?", column, query).reverse_order{ similarity(column, query) }
|
7
7
|
end
|
8
8
|
end
|
9
9
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sequel-pg-trgm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mitchell Henke
|
@@ -9,7 +9,49 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-04-13 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sequel
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>'
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>'
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.14'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.14'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pg
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.17'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.17'
|
13
55
|
description:
|
14
56
|
email: mitchh23@gmail.com
|
15
57
|
executables: []
|
@@ -19,7 +61,8 @@ files:
|
|
19
61
|
- lib/sequel/extensions/pg_trgm.rb
|
20
62
|
- lib/sequel/plugins/pg_trgm.rb
|
21
63
|
homepage: https://github.com/mitchellhenke/sequel-pg-trgm
|
22
|
-
licenses:
|
64
|
+
licenses:
|
65
|
+
- MIT
|
23
66
|
metadata: {}
|
24
67
|
post_install_message:
|
25
68
|
rdoc_options: []
|