Skip to content

Commit

Permalink
v1.0.201
Browse files Browse the repository at this point in the history
  • Loading branch information
yy0931 committed Jan 25, 2025
1 parent c00097d commit 2d743a7
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 92 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ jobs:
vsce_target: linux-arm64-musl
- target: armv7-unknown-linux-gnueabihf
vsce_target: linux-arm-gnu
- target: arm-unknown-linux-musleabi
vsce_target: linux-arm-musl
steps:
- uses: actions/checkout@v1
- uses: dtolnay/rust-toolchain@stable
Expand Down
107 changes: 63 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sqlite3-editor"
version = "1.0.199"
version = "1.0.201"
edition = "2021"

[features]
Expand All @@ -9,7 +9,6 @@ sqlcipher = ["rusqlite/bundled-sqlcipher-vendored-openssl"]

[dependencies]
clap = { version = "4.4.3", features = ["derive"] }
lazy_static = "1.4.0"
percent-encoding = "2.3.0"
regex = "1.9.5"
rmp = "0.8.12"
Expand All @@ -22,7 +21,11 @@ csv = "1.2.2"
base64 = "0.21.4"
hex = "0.4.3"
ts-rs = "7.0.0"
rust_xlsxwriter = "0.52.0"
once_cell = "1.20.2"

# We can't use rust_xlsxwriter>=0.67.0 because it doesn't compile on aarch64.
# rust_xlsxwriter>=0.67.0 uses thiserror-impl 2.0.11 via zip 2.2.2, and it throws the error: "linking with `cc` failed: ..." on aarch64 builds.
rust_xlsxwriter = "0.66.0"

[dependencies.rusqlite]
git = "https://github.com/yy0931/rusqlite.git"
Expand Down
21 changes: 9 additions & 12 deletions src/check_syntax.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use regex::Regex;
use serde::{Deserialize, Serialize};
use sqlparser::tokenizer::{Location, TokenizerError};

Expand All @@ -8,18 +9,14 @@ use crate::{
tokenize::ZeroIndexedLocation,
};

lazy_static! {
static ref PRAGMA: regex::Regex = regex::Regex::new(r"(?i)(?s).*\bPRAGMA[^_a-zA-Z0-9]").unwrap();
static ref QUERY: regex::Regex = regex::Regex::new(r"(?i)(?s).*\bQUERY[^_a-zA-Z0-9]").unwrap();
static ref EXPLAIN: regex::Regex = regex::Regex::new(r"(?i)(?s).*\bEXPLAIN[^_a-zA-Z0-9]").unwrap();
}
static PRAGMA: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?i)(?s).*\bPRAGMA[^_a-zA-Z0-9]").unwrap());
static QUERY: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?i)(?s).*\bQUERY[^_a-zA-Z0-9]").unwrap());
static EXPLAIN: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?i)(?s).*\bEXPLAIN[^_a-zA-Z0-9]").unwrap());

lazy_static! {
static ref SQL_INPUT_ERROR_SYNTAX_ERROR: regex::Regex =
regex::Regex::new(r#"(?i)(?s)^(?:near .*: syntax error|unrecognized token:|incomplete input)"#).unwrap();
static ref SQLITE_FAILURE_SYNTAX_ERROR: regex::Regex =
regex::Regex::new(r#"(?i)(?s)^(?:unknown table option)"#).unwrap();
}
static SQL_INPUT_ERROR_SYNTAX_ERROR: Lazy<Regex> =
Lazy::new(|| Regex::new(r#"(?i)(?s)^(?:near .*: syntax error|unrecognized token:|incomplete input)"#).unwrap());
static SQLITE_FAILURE_SYNTAX_ERROR: Lazy<Regex> =
Lazy::new(|| Regex::new(r#"(?i)(?s)^(?:unknown table option)"#).unwrap());

#[derive(ts_rs::TS, Debug, Eq, PartialEq, Clone, Serialize, Deserialize)]
#[ts(export)]
Expand Down
6 changes: 2 additions & 4 deletions src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::{
util::into,
};
use base64::{engine::general_purpose, Engine as _};
use lazy_static::lazy_static;
use once_cell::sync::Lazy;
use rusqlite::{types::ValueRef, Connection};
use serde::{Deserialize, Serialize};
use std::{collections::HashSet, io::Write};
Expand Down Expand Up @@ -171,9 +171,7 @@ pub struct XLSXExportOptions {
pub active_sheet: Option<String>,
}

lazy_static! {
static ref INVALID_SHEET_NAME_PATTERN: regex::Regex = regex::Regex::new(r"[*?:\[\]\\/]|^'|'$").unwrap();
}
static INVALID_SHEET_NAME_PATTERN: Lazy<regex::Regex> = Lazy::new(|| regex::Regex::new(r"[*?:\[\]\\/]|^'|'$").unwrap());

/// - Integer values between i32::MIN and i32::MAX are encoded as i32. Values outside this range are rounded to the nearest f64 values because Excel does not support 64-bit integers.
/// - NULL is encoded as an empty string.
Expand Down
Loading

0 comments on commit 2d743a7

Please sign in to comment.