fast & easy CLI and vscode extension specialized to format MySQL INSERT queries.

Related tags

Database insertfmt
Overview

Test status Docs Dependency status

Rust version Crates.io

insertfmt

fast & easy CLI specialized to format MySQL INSERT queries.

format queries so that they look like a table.

preview

NOTE: If you wanna use the VSCode extension, please get it from the below link. Thanks! https://marketplace.visualstudio.com/items?itemName=canalun.insertfmt

Installation

You can download the binary from releases.

The binary is self-sufficient with no dependencies, and can be put anywhere on your PATH and run with insertfmt command!!

Or, you can also install the module directly with cargo.

cargo install insertfmt

Basic Usage

To run the tool, run the command with a path argument:

insertfmt x.sql y.sql <...>

You can specify as many paths as you want.

Release Note

v1.0.3

  • fix bug of backslash disappearance!

v1.0.1-1.0.2

  • fix error msg

v1.0.0

  • HBD 🎂
  • vSQLfmt gets able to format 'INSERT' queries!

Monorepo

This repository is a monorepo of Rust CLI and TS+Wasm VSCode extension.

If you are interested in it technically, why not check out the below article 🌟

dev.to: Monorepo of Rust CLI & TS+Wasm VSCode

Contribution

You wanna contribute!? Thanks!!!! Would be great if you check the below doc out 😊

CONTRIBUTING.md

Comments
  • bug: backslashes disappear

    bug: backslashes disappear

    when formatting queries including backslashes, they disappear. e.g. before format: INSERT INTO ... ('aaa', 'bbb\"a\"bb'); after format: INSERT INTO ... ('aaa', 'bbb"a"bb');

    opened by canalun 2
  • mod issue of backslash disappear

    mod issue of backslash disappear

    fix #1 by change dependency for sqlparser from the original to the forked mine.

    memo: would be better to discuss the admin of the lib and create pr if possible.

    opened by canalun 0
  • Bump regex from 1.7.1 to 1.8.1

    Bump regex from 1.7.1 to 1.8.1

    Bumps regex from 1.7.1 to 1.8.1.

    Changelog

    Sourced from regex's changelog.

    1.8.1 (2023-04-21)

    This is a patch release that fixes a bug where a regex match could be reported where none was found. Specifically, the bug occurs when a pattern contains some literal prefixes that could be extracted and an optional word boundary in the prefix.

    Bug fixes:

    • [BUG #981](rust-lang/regex#981): Fix a bug where a word boundary could interact with prefix literal optimizations and lead to a false positive match.

    1.8.0 (2023-04-20)

    This is a sizeable release that will be soon followed by another sizeable release. Both of them will combined close over 40 existing issues and PRs.

    This first release, despite its size, essentially represent preparatory work for the second release, which will be even bigger. Namely, this release:

    • Increases the MSRV to Rust 1.60.0, which was released about 1 year ago.
    • Upgrades its dependency on aho-corasick to the recently release 1.0 version.
    • Upgrades its dependency on regex-syntax to the simultaneously released 0.7 version. The changes to regex-syntax principally revolve around a rewrite of its literal extraction code and a number of simplifications and optimizations to its high-level intermediate representation (HIR).

    The second release, which will follow ~shortly after the release above, will contain a soup-to-nuts rewrite of every regex engine. This will be done by bringing regex-automata into this repository, and then changing the regex crate to be nothing but an API shim layer on top of regex-automata's API.

    These tandem releases are the culmination of about 3 years of on-and-off work that began in earnest in March 2020.

    Because of the scale of changes involved in these releases, I would love to hear about your experience. Especially if you notice undocumented changes in behavior or performance changes (positive or negative).

    Most changes in the first release are listed below. For more details, please see the commit log, which reflects a linear and decently documented history of all changes.

    New features:

    ... (truncated)

    Commits
    • 4e29fce 1.8.1
    • 8a7cb64 deps: bump regex-syntax to 0.7.1
    • 31c8452 regex-syntax-0.7.1
    • 960aade changelog: 1.8.1
    • f003d72 impl: fix prefix literal matching bug
    • 93316a3 doc: update MSRV in README
    • 070374f release: 1.8.0
    • a73c61c fuzz: get rid of 'named-profiles' feature
    • 7cd75d2 changelog: tweaks to 1.8 release entry
    • 33898de syntax: fix bug in new alternation literal analysis
    • Additional commits viewable in compare view

    Dependabot compatibility score

    You can trigger a rebase of this PR by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump sqlparser from 0.32.0 to 0.33.0

    Bump sqlparser from 0.32.0 to 0.33.0

    Bumps sqlparser from 0.32.0 to 0.33.0.

    Changelog

    Sourced from sqlparser's changelog.

    [0.33.0] 2023-04-10

    Added

    Changed

    Commits
    • 00719e3 (cargo-release) version 0.33.0
    • 28e558c Changelog for 0.33.0 (#846)
    • 04d9f3a Added support for Mysql Backslash escapes (enabled by default) (#844)
    • 00d0712 Move tests from parser.rs to appropriate parse_XX tests (#845)
    • 784a191 Support "UPDATE" statement in "WITH" subquery (#842)
    • 29dea5d support PIVOT table syntax (#836)
    • 79c7ac7 support CREATE/DROP STAGE for Snowflake (#833)
    • a1b7341 Non-Latin characters support (#840)
    • eb67d48 Correct typos in parser.rs (#838)
    • a8a8e65 PostgreSQL: GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY and GENERATED ALWA...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    You can trigger a rebase of this PR by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • ci/cd: add cd for release of vscode extension

    ci/cd: add cd for release of vscode extension

    would be nice to add cd for release of vscode extension. basically, just do the following things by github actions.

    • make gen-wasm-for-extension
    • yarn in vscode-extension dir
    • build extension
    • vsce publish [tag]
    opened by canalun 2
Releases(v1.0.3)
Owner
canalun
webdev
canalun
A tool for automated migrations for PostgreSQL, SQLite and MySQL.

Models Models is an implementation for a SQL migration management tool. It supports PostgreSQL, MySQL, and SQLite. Quick Start install the CLI by runn

null 45 Nov 16, 2022
CRUD example with Rocket, Toql and MySQL

Todo (Rocket, Toql, MySQL) This is a little REST server built with Rocket, Toql and MySQL. The server allows to call CRUD functions on a Todo item. It

Artos 7 Jan 5, 2022
A highly scalable MySQL Proxy framework written in Rust

mysql-proxy-rs An implementation of a MySQL proxy server built on top of tokio-core. Overview This crate provides a MySQL proxy server that you can ex

AgilData 175 Dec 19, 2022
Asyncronous Rust Mysql driver based on Tokio.

mysql-async Tokio based asynchronous MySql client library for rust programming language. Installation Library hosted on crates.io. [dependencies] mysq

Anatoly I 292 Dec 30, 2022
Mysql client library implemented in rust.

mysql This crate offers: MySql database driver in pure rust; connection pool. Features: macOS, Windows and Linux support; TLS support via nativetls cr

Anatoly I 548 Dec 31, 2022
A user crud written in Rust, designed to connect to a MySQL database with full integration test coverage.

SQLX User CRUD Purpose This application demonstrates the how to implement a common design for CRUDs in, potentially, a system of microservices. The de

null 78 Nov 27, 2022
cogo rust coroutine database driver (Mysql,Postgres,Sqlite)

cdbc Coroutine Database driver Connectivity.based on cogo High concurrency,based on coroutine No Future<'q,Output=*>,No async fn, No .await , no Poll*

co-rs 10 Nov 13, 2022
Gibbs MySQL Spyglass

Gibbs MySQL Spyglass Ahoy Matey! The Gibbs MySQL Spyglass is a application used to capture application traffic into a MySQL database. It is designed t

AgilData 82 Nov 14, 2021
rust-mysql-simple support library for the r2d2 connection pool

r2d2-mysql rust-mysql-simple support library for the r2d2 connection pool.

outersky 44 Nov 1, 2022
This project provides a Rust-based solution for migrating MSSQL databases to MySQL.

MSSQL to MySQL Database Migration A Rust project to migrate MSSQL databases to MySQL, including table structures, column data types, and table data ro

Bitalizer 2 Jul 10, 2023
A query builder that builds and typechecks queries at compile time

typed-qb: a compile-time typed "query builder" typed-qb is a compile-time, typed, query builder. The goal of this crate is to explore the gap between

ferrouille 3 Jan 22, 2022
Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres.

SDB - SignatureDB Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres

Fremantle Industries 5 Apr 26, 2022
Rust library to parse, deparse and normalize SQL queries using the PostgreSQL query parser

This Rust library uses the actual PostgreSQL server source to parse SQL queries and return the internal PostgreSQL parse tree.

pganalyze 37 Dec 18, 2022
An object-relational in-memory cache, supports queries with an SQL-like query language.

qlcache An object-relational in-memory cache, supports queries with an SQL-like query language. Warning This is a rather low-level library, and only p

null 3 Nov 14, 2021
Run SQL queries on CSV files

zsql run SQL queries on csv files A terminal utility to easily run SQL queries on CSV files. zsql is shipped as a small single binary powered by rust

Zizaco 9 Jul 9, 2022
Running SQL-like queries on files.

filesql Running SQL-like queries on files. Features Supported: REPL Basic SQL expressions. INSERT clause. (which inserts data into another file) WHERE

Zhang Li 1 Nov 15, 2021
This crate allows you to send cypher queries to the REST endpoint of a neo4j database

rusted_cypher Rust crate for accessing the cypher endpoint of a neo4j server This crate allows you to send cypher queries to the REST endpoint of a ne

Livio Ribeiro 68 Dec 1, 2022
Implementation of generic IBC queries in CosmWasm.

CosmWasm IBC Queries Implements generic IBC queries in CosmWasm. This implementation requires the same contract to be deployed on both chains wishing

Jake Hartnell 17 Oct 6, 2022
Example sqlite3 Dynamic Loadable Extension in Rust - vfs and vtab modules - port of vfsstat.c

Example sqlite3 Dynamic Loadable Extension in Rust - vfs and vtab modules The vfs and vtab This is a port of the official ext/misc/vfsstat.c sqlite3 e

Manos Pitsidianakis 28 Oct 10, 2022