-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.ini
87 lines (78 loc) · 4.23 KB
/
config.ini
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
# General configuration parameters
# All these values can be altered during a session using commands
#
# rows_to_print=How many rows of the results to print. 0 means "print all".
# Change it at runtime using :rows
#
# column_display_length=How many characters per column to print before
# truncating the value with "[...]". 0 means "print
# everything" Change it at runtime using :chars
#
# null_string=What to show when a value is NULL in the output. Change at
# runtime using :null
# newline_replacement=Specify the character(s) to replace newlines. Empty means
# not to replace them. Change it at runtime using :newline
#
# tab_replacement=Specify the character(s) to replace tab chars. Empty means
# not to replace them. Change it at runtime using :tab
#
# command_timeout=Seconds for command timeouts - how long to wait for a command
# to finish running. This is set in the ODBC connection, use 0
# to "wait forever".
[general]
rows_to_print=50
column_display_length=100
null_string=[NULL]
newline_replacement=[NL]
tab_replacement=[TAB]
command_timeout=30
# Queries can use Python's format syntax for "replacement parameters", for
# example a query
# top10=SELECT TOP 10 FROM {table_name}
# will be invoked as
# >:top10
# And then prompt for a value for "table_name".
# This allows for commands that replace any text in the query, almost without
# limitations. Multiple parameters can be used.
# Any ? character can be used as a "query parameter" (ODBC standard). This is
# good to get values escaped. You can also combine both types of parameters:
# top_by_id=SELECT TOP {how_many} FROM {table} WHERE Name = ?
# will be invoked as
# >:top_by_id
# and then you will be prompted first for values for how_many and table. And
# once the query is formatted, there will be another prompt for a value for ?.
# It won't matter if the value for "Name" contains a single quote or any other
# special character, it gets escaped.
[queries]
# These are sample queries to showcase the parameter options
top=SELECT TOP {how_many} * FROM {table}
top-field=SELECT TOP {how_many} * FROM {table} WHERE {field} = ?
limit=SELECT * FROM {table} WHERE ItemId = ? LIMIT {how_many}
# These are useful general commands, using INFORMATION_SCHEMA covers most DB
# engines. You can always customize them for other engines.
# Notice that we use a bit of trickery to specify a partial name in the parameter, or accept * as meaning "all"
# NOTE: don't forget to escape % with %% :)
tables=SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME LIKE '%%{table_name}%%' OR '{table_name}' = '*'
cols=SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '{table_name}'
views=SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, CHECK_OPTION, IS_UPDATABLE FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_NAME LIKE '%%{table_name}%%' OR '{table_name}' = '*'
procs=SELECT ROUTINE_CATALOG, ROUTINE_SCHEMA, ROUTINE_NAME, DATA_TYPE, CREATED, LAST_ALTERED FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'PROCEDURE' AND ROUTINE_NAME LIKE '%%{proc_name}%%' OR '{proc_name}' = '*'
funcs=SELECT ROUTINE_CATALOG, ROUTINE_SCHEMA, ROUTINE_NAME, DATA_TYPE, CREATED, LAST_ALTERED FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'FUNCTION' AND ROUTINE_NAME LIKE '%%{func_name}%%' OR '{func_name}' = '*'
# MS SQL Server specific
# Print source of a stored procedure. Advice: set col display to 0 to avoid
# truncating the output
mssrc=sp_helptext N'{obj_name}'
# Show elements that depend on {object}
msdepon=EXEC sp_MSdependencies N'{obj_name}', NULL, 1315327
# Show elements that are a depency for {object}
msdepfor=EXEC sp_MSdependencies N'{obj_name}', NULL, 1053183
msdbs=SELECT name as 'Database Name' FROM master.dbo.sysdatabases
# MySQL specific
mysqldbs=SHOW DATABASES
# PostgreSQL
postgredbs=SELECT datname FROM pg_database
# Snowflake
snowtables=SHOW TERSE TABLES
snowprocs=SHOW PROCEDURES
# Oracle
oratables=SELECT TABLE_NAME FROM user_tables WHERE LOWER(table_name) like '%%{table_name}%%' OR '{table_name}' = '*'
oracols=SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH, NULLABLE FROM user_tab_columns WHERE LOWER(table_name) = LOWER('{table_name}')