sqlfmt

SQL Formatter

  • 所有者: jackc/sqlfmt
  • 平台:
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

sqlfmt

Installation

$ go get github.com/jackc/sqlfmt/...
$ which sqlfmt
$GOPATH/bin/sqlfmt

Usage

  • You can either:

    • Provide the path to one or more SQL files as command line arguments:

      $ sqlfmt testdata/select_where.input.sql
      select
        foo,
        bar
      from
        baz
      where
        foo > 5
        and bar < 2
      
    • Or, directly provide the SQL string via stdin:

      $ echo "select * from users", sqlfmt
      select
        *
      from
        users
      
      $ sqlfmt < testdata/like.input.sql
      select
        foo,
        bar
      from
        baz
      where
        foo like 'abd%'
        or foo like 'ada%' escape '!'
        or foo not like 'abd%'
        or foo not like 'ada%' escape '!'
        or foo ilike 'efg%'
        or foo ilike 'ada%' escape '!'
        or foo not ilike 'efg%'
        or foo not ilike 'ada%' escape '!'
      
  • View testdata for more examples.

主要指標

概覽
名稱與所有者jackc/sqlfmt
主編程語言Yacc
編程語言Go (語言數: 2)
平台
許可證Apache License 2.0
所有者活动
創建於2015-06-13 17:31:09
推送於2019-12-21 21:12:51
最后一次提交2019-12-21 15:12:49
發布數2
最新版本名稱v0.1.0 (發布於 )
第一版名稱v0.0.1 (發布於 )
用户参与
星數337
關注者數9
派生數25
提交數199
已啟用問題?
問題數6
打開的問題數3
拉請求數4
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?