sqlcomposer 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4a9f80b9423da65cfcb4c3e9ded0aa4db06a4d7c6e40e2e9f040b37ded3a09b
4
- data.tar.gz: 121caab90eece8f514cac7904d95f3f8a5764b405566d121ed0fb29de771fe29
3
+ metadata.gz: 40e7b659678f995f60e75435e8faede5015d5211bf138a3ad79ce2755a2f5abf
4
+ data.tar.gz: 24f6061fec370299f39edfe5f6fac7ada0dd04c1fb73a53605b3f0d8540d5a14
5
5
  SHA512:
6
- metadata.gz: 7b1cffc0587e1e551ba1870c19d7ca30ccdc917a60893d0ef7a867b5cc8741f3228c00ca6bfff5c60bafec5dfc047ef99bf4efbe7fc0c84b31324ef6dd27de02
7
- data.tar.gz: 32a089020ff2e1e7fde592694a1c9ee015afcb50bba9c82d55b71da2a21e2ae847ca8ffca78e661a89ff6187ab20f1565b43efe14e3057e2540d64d993f76913
6
+ metadata.gz: b2a4f920054edf04fe34886a840c627526bc8151a97b3425536489f63da39df115481320424d259c207ded1555151e5ad62841001963be9856fa507f784748cd
7
+ data.tar.gz: 2a6466f18dc5d02b17a21cdc5587ae7179210bc62a8f079ba4f3b2f612e250babda0d549f419c4b710ff033d484b65e68cf4fc09a353fd5a0ea6b303471545dd
data/Gemfile.lock CHANGED
@@ -44,4 +44,4 @@ DEPENDENCIES
44
44
  sqlcomposer!
45
45
 
46
46
  BUNDLED WITH
47
- 1.17.2
47
+ 2.2.3
data/README.md CHANGED
@@ -1,28 +1,33 @@
1
1
  # Sqlcomposer
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/sqlcomposer`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Compose SQL from Mybatis log
6
4
 
7
5
  ## Installation
8
6
 
9
- Add this line to your application's Gemfile:
7
+ Install it yourself as:
10
8
 
11
- ```ruby
12
- gem 'sqlcomposer'
13
- ```
9
+ $ gem install sqlcomposer
14
10
 
15
- And then execute:
11
+ Or:
16
12
 
17
- $ bundle
13
+ $ sudo gem install sqlcomposer
18
14
 
19
- Or install it yourself as:
15
+ ## Usage
20
16
 
21
- $ gem install sqlcomposer
17
+ Copy log content like this:
22
18
 
23
- ## Usage
19
+ ```
20
+ 2019-05-10 10:27:22.023 [XNIO-2 task-3] DEBUG c.k.d.s.s.r.m.S.getPerson - ==> Preparing: SELECT * FROM person where name = ? and age = ?
21
+ 2019-05-10 10:27:22.025 [XNIO-2 task-3] DEBUG c.k.d.s.s.r.m.S.getPerson - ==> Parameters: 张三(String), 20(Integer)
22
+ ```
23
+
24
+ then execute:
25
+
26
+ $ pbpaste | sqlcomposer
27
+
28
+ will print out:
24
29
 
25
- TODO: Write usage instructions here
30
+ SELECT * FROM person where name = '张三' and age = 20 ;
26
31
 
27
32
  ## Development
28
33
 
@@ -28,7 +28,7 @@ module Sqlcomposer
28
28
  def parse_params(raw_sql, line)
29
29
  return [] unless raw_sql
30
30
  raw_params = line.split(/=>\s+Parameters:/).last.chomp.strip
31
- raw_params.split(/,\s*/).map do |raw_param|
31
+ raw_params.split(/(?<=\)), /).map do |raw_param|
32
32
  raw_param.strip.scan(/([^()]+)\((\w+?)\)/).first
33
33
  end
34
34
  end
@@ -1,3 +1,3 @@
1
1
  module Sqlcomposer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqlcomposer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Liu Xiang
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-08 00:00:00.000000000 Z
11
+ date: 2022-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: niceql
@@ -108,7 +108,7 @@ homepage: https://github.com/lululau/sqlcomposer
108
108
  licenses:
109
109
  - MIT
110
110
  metadata: {}
111
- post_install_message:
111
+ post_install_message:
112
112
  rdoc_options: []
113
113
  require_paths:
114
114
  - lib
@@ -123,8 +123,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: []
126
- rubygems_version: 3.0.3
127
- signing_key:
126
+ rubygems_version: 3.3.3
127
+ signing_key:
128
128
  specification_version: 4
129
129
  summary: Compose SQL from Mybatis log
130
130
  test_files: []