-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsqlfix.txt
108 lines (82 loc) · 3.1 KB
/
sqlfix.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
*sqlfix.txt* SQL pretty print.
Author: KazuakiM <twitter@NanohaAsOnKai>
License: MIT License.
==============================================================================
CONTENTS *sqlfix-contents*
INTRODUCTION |sqlfix-introduction|
INTERFACE |sqlfix-interface|
OPTIONS |sqlfix-options|
COMMANDS |sqlfix-commands|
FUNCTIONS |sqlfix-functions|
==============================================================================
INTRODUCTION *sqlfix-introduction*
This Vim plugin is SQL pretty print.
vim-sqlfix's goal is support FrameWork application log format.
==============================================================================
INTERFACE *sqlfix-interface*
------------------------------------------------------------------------------
OPTIONS *sqlfix-options*
g:sqlfix#Config = {list} *g:sqlfix#Config*
This variable is plugin config variable.
>
let g:sqlfix#Config = {
\ 'database': 'postgresql',
\ 'indent': 2,
\ 'width': -1,
\ 'explain': 1,
\ 'output': 1,
\ 'direcotry_path': ''}
<
database *sqlfix-options-database*
Set useing database, 'mysql' or 'postgresql'.
Default value is 'mysql'.
indent *sqlfix-options-indent*
Set indent spaces. Default value is '4'.
width *sqlfix-options-width*
Set line length. This function is invalidated by '-1'.
Default value is '180'.
explain *sqlfix-options-explain*
If you want to set a 'EXPLAIN( ANALYZE)', you set '1'.
Default value is '0'(disable).
output *sqlfix-options-output*
If you want to output at buffer, you set '1'.
Default value is '1'(enable).
direcotry_path *sqlfix-options-direcotry_path*
If you want SQL file or |SqlffixRun|, you set directory
path. Default value is ''(disable).
------------------------------------------------------------------------------
COMMANDS *sqlfix-commands*
:Sqlfix *:Sqlfix*
Execute |sqlfix#Normal()|.
:'<,'>Sqlfix *:'<,'>Sqlfix*
Execute |sqlfix#Visual()|.
:SqlfixFile *:SqlfixFile*
Execute |sqlfix#NormalFile()|.
:'<,'>SqlfixFile *:'<,'>SqlfixFile*
Execute |sqlfix#VisualFile()|.
:SqlfixRun *:SqlfixRun*
Execute |sqlfix#Run()|.
------------------------------------------------------------------------------
FUNCTIONS *sqlfix-functions*
sqlfix#Normal() *sqlfix#Normal()*
The last selected text(SQL) in visual mode is formatted at Buffer.
sqlfix#Visual() *sqlfix#Visual()*
Now selected text(SQL) in visual mode is formatted at Buffer.
sqlfix#NormalFile() *sqlfix#NormalFile()*
The last selected text(SQL) in visual mode is formatted at File.
sqlfix#VisualFile() *sqlfix#VisualFile()*
Now selected text(SQL) in visual mode is formatted at File.
sqlfix#Run() *sqlfix#Run()*
This function is depend on |quickrun| and
|sqlfix-options-direcotry_path|.
MySQL sample
>
let g:quickrun_config = {
\ 'sql': {'type': 'sql/mysql'},
\ 'sql/mysql': {
\ 'cmdopt':
\ '--user=root --password= --host=localhost '.
\ '--port=3306 --database=sample --connect-timeout=5'}
<
==============================================================================
vim:tw=78:ts=8:ft=help:norl