exwiw 0.4.4 → 0.4.6

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: '028047197ff7f7e93fdda9b7ca4ad934da9ac904c53bc7859da113f89710de23'
4
- data.tar.gz: 2e7ef72dd106f3133ab6ba35b752c5c961fb02da02b98ede71400285fc36a2e5
3
+ metadata.gz: dac24d68af7c0c39949a11c810cccc14e6818ac0edb9198a3a6b846d2d81bcee
4
+ data.tar.gz: c4b111dc3dccc8940627b7dcabf2ea5633300eb5e670b52ec8683e78a2922040
5
5
  SHA512:
6
- metadata.gz: f33e62a4df3f5bacfb20a20bb18defcb3e6296a404981afa4b5ace3ac2153fa58f408cbea8fbf5aea83da66dbec3513c49c16ae6670324cebf767cfe0894c870
7
- data.tar.gz: 2395aed648209edde5afa7a38bae47088e9327e562f42c166ec259d69aba270fb3689d3b472aeffdfbc185dc8b30501b2963e28c301d4f04b90c56b815ae65ba
6
+ metadata.gz: 15cdaa9351b32c3159f27a79204506f557825441d2c8253da5981d0e903504240963fcf279a34c28b02f084004f9d728499ee8fb3ea609a94b3583b72f8b8ce8
7
+ data.tar.gz: 7b7de3276484ce8bb97164f26aed9dc23f25f51736065c0f3f15337be49f82db322bbe16534fc77c0ad85fefd55fa1e825b25933b8c2f0e85e50694da6333f2f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.4.6] - 2026-06-08
6
+
7
+ ### Fixed
8
+
9
+ - MySQL: INSERT statements now escape backslashes (`\` → `\\`) in string literals. Previously, values containing backslashes — such as JSON columns with `\"` sequences — were corrupted on restore because MySQL interprets `\` as an escape character in single-quoted strings. ([#85](https://github.com/heyinc/exwiw/pull/85))
10
+
11
+ ## [0.4.5] - 2026-06-08
12
+
13
+ ### Fixed
14
+
15
+ - MySQL: INSERT statements now backtick-quote table and column names. Previously, columns whose name is a MySQL reserved word (e.g. `key` in `active_storage_blobs`) caused syntax errors on restore. ([#83](https://github.com/heyinc/exwiw/pull/83))
16
+
5
17
  ## [0.4.4] - 2026-06-05
6
18
 
7
19
  ### Fixed
@@ -111,10 +111,10 @@ module Exwiw
111
111
  values = value_list.join(",\n")
112
112
 
113
113
  if table.rails_managed?
114
- "INSERT INTO #{table_name} VALUES\n#{values};"
114
+ "INSERT INTO `#{table_name}` VALUES\n#{values};"
115
115
  else
116
- column_names = table.columns.map(&:name).join(', ')
117
- "INSERT INTO #{table_name} (#{column_names}) VALUES\n#{values};"
116
+ column_names = table.columns.map { |c| "`#{c.name}`" }.join(', ')
117
+ "INSERT INTO `#{table_name}` (#{column_names}) VALUES\n#{values};"
118
118
  end
119
119
  end
120
120
 
@@ -249,7 +249,8 @@ module Exwiw
249
249
  when nil
250
250
  "NULL"
251
251
  when String
252
- qv = escape_single_quote(value)
252
+ qv = value.gsub('\\') { '\\\\' }
253
+ qv = escape_single_quote(qv)
253
254
  "'#{qv}'"
254
255
  else
255
256
  value
data/lib/exwiw/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Exwiw
4
- VERSION = "0.4.4"
4
+ VERSION = "0.4.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exwiw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shia