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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?