Package sqlline
Class SqlLineOpts
java.lang.Object
sqlline.SqlLineOpts
- All Implemented Interfaces:
org.jline.reader.Completer
public class SqlLineOpts
extends java.lang.Object
implements org.jline.reader.Completer
Session options.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_NAME_EXIT
static java.lang.String
PROPERTY_PREFIX
-
Constructor Summary
Constructors Constructor Description SqlLineOpts(SqlLine sqlLine)
SqlLineOpts(SqlLine sqlLine, java.util.Properties props)
-
Method Summary
Modifier and Type Method Description void
complete(org.jline.reader.LineReader lineReader, org.jline.reader.ParsedLine parsedLine, java.util.List<org.jline.reader.Candidate> list)
java.lang.String
get(java.lang.String key)
java.lang.String
get(SqlLineProperty key)
boolean
getAutoCommit()
boolean
getAutoPairing()
boolean
getAutoResize()
boolean
getAutosave()
Deprecated.UsegetAutoSave()
boolean
getAutoSave()
boolean
getBoolean(SqlLineProperty key)
char
getChar(SqlLineProperty key)
boolean
getColor()
java.lang.String
getColorScheme()
java.util.regex.Pattern
getCompiledConfirmPattern()
boolean
getConfirm()
java.lang.String
getConfirmPattern()
java.lang.String
getConnectionConfig()
java.lang.String
getCsvDelimiter()
char
getCsvQuoteCharacter()
java.lang.String
getDateFormat()
boolean
getEscapeOutput()
boolean
getFastConnect()
boolean
getForce()
int
getHeaderInterval()
java.lang.String
getHistoryFile()
java.lang.String
getHistoryFlags()
boolean
getIncremental()
int
getIncrementalBufferRows()
int
getInt(SqlLineProperty key)
java.lang.String
getIsolation()
boolean
getKeepSemicolon()
java.lang.String
getLiveTemplatesFile()
int
getMaxColumnWidth()
int
getMaxHeight()
int
getMaxWidth()
java.lang.String
getMode()
java.lang.String
getNullValue()
java.lang.String
getNumberFormat()
java.lang.String
getOutputFormat()
java.lang.String
getPrompt()
java.lang.String
getPropertiesFile()
boolean
getReadOnly()
java.lang.String
getRightPrompt()
int
getRowLimit()
java.lang.String
getRun()
java.lang.String
getScriptEngine()
boolean
getShowCompletionDescr()
boolean
getShowElapsedTime()
boolean
getShowHeader()
boolean
getShowLineNumbers()
boolean
getShowNestedErrs()
boolean
getShowTypes()
boolean
getShowWarnings()
boolean
getSilent()
boolean
getStrictJdbc()
java.lang.String
getTableStyle()
java.lang.String
getTimeFormat()
int
getTimeout()
java.lang.String
getTimestampFormat()
boolean
getTrimScripts()
boolean
getUseLineContinuation()
boolean
getVerbose()
boolean
hasProperty(java.lang.String name)
java.util.List<org.jline.reader.Completer>
helpCompleters()
boolean
isDefault(SqlLineProperty property)
Returns whether the property is its default value.void
load()
void
load(java.io.InputStream fin)
void
loadProperties(java.util.Properties props)
java.util.Set<java.lang.String>
propertyNames()
java.util.List<org.jline.reader.Completer>
resetOptionCompleters()
void
save()
void
save(java.io.OutputStream out)
static java.io.File
saveDir()
The save directory if HOME/.sqlline/ on UNIX, and HOME/sqlline/ on Windows.boolean
set(java.lang.String key, boolean value, boolean quiet)
void
set(java.lang.String key, java.lang.String value)
boolean
set(java.lang.String key, java.lang.String value, boolean quiet)
void
set(SqlLineProperty key, java.lang.Object value)
void
setAutoPairing(java.lang.String newValue)
void
setColorScheme(java.lang.String colorScheme)
void
setConfirmPattern(java.lang.String confirmPattern)
void
setConnectionConfig(java.lang.String filename)
void
setCsvQuoteCharacter(java.lang.String csvQuoteCharacter)
void
setDateFormat(java.lang.String dateFormat)
boolean
setEmptyValue(java.lang.String key, boolean quiet)
void
setHistoryFile(java.lang.String historyFile)
void
setIsolation(java.lang.String isolation)
void
setLiveTemplatesFile(java.lang.String fileName)
void
setMaxHistoryFileRows(java.lang.String maxHistoryFileRows)
void
setMaxHistoryRows(java.lang.String maxHistoryRows)
void
setMode(java.lang.String mode)
void
setNumberFormat(java.lang.String numberFormat)
java.util.List<org.jline.reader.Completer>
setOptionCompleters(java.util.Map<BuiltInProperty,java.util.Collection<java.lang.String>> customCompletions)
Builds and returnsCompleters.RegexCompleter
for!set
command based on (in decreasing order of priority) Customizations viacustomCompletions
Available values defined inBuiltInProperty
SqlLineProperty.Type
of property.void
setOutputFormat(java.lang.String outputFormat)
void
setPropertiesFile(java.lang.String propertyFile)
void
setRun(java.lang.String runFile)
void
setScriptEngine(java.lang.String engineName)
void
setShowCompletionDesc(java.lang.String setShowCompletionDesc)
void
setTableStyle(java.lang.String tableStyle)
void
setTimeFormat(java.lang.String timeFormat)
void
setTimestampFormat(java.lang.String timestampFormat)
java.util.Properties
toProperties()
java.util.Properties
toProperties(boolean toSave)
-
Field Details
-
PROPERTY_PREFIX
public static final java.lang.String PROPERTY_PREFIX- See Also:
- Constant Field Values
-
PROPERTY_NAME_EXIT
public static final java.lang.String PROPERTY_NAME_EXIT- See Also:
- Constant Field Values
-
-
Constructor Details
-
Method Details
-
resetOptionCompleters
public java.util.List<org.jline.reader.Completer> resetOptionCompleters() -
setOptionCompleters
public java.util.List<org.jline.reader.Completer> setOptionCompleters(java.util.Map<BuiltInProperty,java.util.Collection<java.lang.String>> customCompletions)Builds and returnsCompleters.RegexCompleter
for!set
command based on (in decreasing order of priority)- Customizations via
customCompletions
- Available values defined in
BuiltInProperty
SqlLineProperty.Type
of property. Currently there is completion only for boolean type
- Parameters:
customCompletions
- defines custom completions values per property- Returns:
- a singleton list with a built RegexCompleter
- Customizations via
-
helpCompleters
public java.util.List<org.jline.reader.Completer> helpCompleters() -
saveDir
public static java.io.File saveDir()The save directory if HOME/.sqlline/ on UNIX, and HOME/sqlline/ on Windows.- Returns:
- save directory
-
complete
public void complete(org.jline.reader.LineReader lineReader, org.jline.reader.ParsedLine parsedLine, java.util.List<org.jline.reader.Candidate> list)- Specified by:
complete
in interfaceorg.jline.reader.Completer
-
save
public void save() throws java.io.IOException- Throws:
java.io.IOException
-
save
public void save(java.io.OutputStream out) -
propertyNames
public java.util.Set<java.lang.String> propertyNames() -
toProperties
public java.util.Properties toProperties() -
toProperties
public java.util.Properties toProperties(boolean toSave) -
load
public void load() throws java.io.IOException- Throws:
java.io.IOException
-
load
public void load(java.io.InputStream fin) throws java.io.IOException- Throws:
java.io.IOException
-
loadProperties
public void loadProperties(java.util.Properties props) -
setEmptyValue
public boolean setEmptyValue(java.lang.String key, boolean quiet) -
set
public void set(java.lang.String key, java.lang.String value) -
set
public boolean set(java.lang.String key, boolean value, boolean quiet) -
set
public boolean set(java.lang.String key, java.lang.String value, boolean quiet) -
hasProperty
public boolean hasProperty(java.lang.String name) -
get
-
getChar
-
getInt
-
getBoolean
-
isDefault
Returns whether the property is its default value.This true if it has not been assigned a value, or if has been assigned a value equal to its default value.
- Parameters:
property
- Property- Returns:
- whether property has its default value
-
get
public java.lang.String get(java.lang.String key) -
set
-
getFastConnect
public boolean getFastConnect() -
getAutoCommit
public boolean getAutoCommit() -
getReadOnly
public boolean getReadOnly() -
getVerbose
public boolean getVerbose() -
getShowElapsedTime
public boolean getShowElapsedTime() -
getShowWarnings
public boolean getShowWarnings() -
getShowCompletionDescr
public boolean getShowCompletionDescr() -
getShowNestedErrs
public boolean getShowNestedErrs() -
getShowTypes
public boolean getShowTypes() -
getNumberFormat
public java.lang.String getNumberFormat() -
getEscapeOutput
public boolean getEscapeOutput() -
setNumberFormat
public void setNumberFormat(java.lang.String numberFormat) -
getDateFormat
public java.lang.String getDateFormat() -
setDateFormat
public void setDateFormat(java.lang.String dateFormat) -
getTimeFormat
public java.lang.String getTimeFormat() -
setTimeFormat
public void setTimeFormat(java.lang.String timeFormat) -
getTimestampFormat
public java.lang.String getTimestampFormat() -
setTimestampFormat
public void setTimestampFormat(java.lang.String timestampFormat) -
setShowCompletionDesc
public void setShowCompletionDesc(java.lang.String setShowCompletionDesc) -
getNullValue
public java.lang.String getNullValue() -
getRowLimit
public int getRowLimit() -
getTimeout
public int getTimeout() -
getIsolation
public java.lang.String getIsolation() -
setIsolation
public void setIsolation(java.lang.String isolation) -
getHistoryFile
public java.lang.String getHistoryFile() -
setHistoryFile
public void setHistoryFile(java.lang.String historyFile) -
setColorScheme
public void setColorScheme(java.lang.String colorScheme) -
getColorScheme
public java.lang.String getColorScheme() -
getColor
public boolean getColor() -
getConnectionConfig
public java.lang.String getConnectionConfig() -
setConnectionConfig
public void setConnectionConfig(java.lang.String filename) -
getCsvDelimiter
public java.lang.String getCsvDelimiter() -
getCsvQuoteCharacter
public char getCsvQuoteCharacter() -
setMaxHistoryRows
public void setMaxHistoryRows(java.lang.String maxHistoryRows) -
setMaxHistoryFileRows
public void setMaxHistoryFileRows(java.lang.String maxHistoryFileRows) -
setCsvQuoteCharacter
public void setCsvQuoteCharacter(java.lang.String csvQuoteCharacter) -
getShowHeader
public boolean getShowHeader() -
getHeaderInterval
public int getHeaderInterval() -
getForce
public boolean getForce() -
getIncremental
public boolean getIncremental() -
getIncrementalBufferRows
public int getIncrementalBufferRows() -
getSilent
public boolean getSilent() -
getAutosave
@Deprecated public boolean getAutosave()Deprecated.UsegetAutoSave()
- Returns:
- true if auto save is on, false otherwise
-
getAutoSave
public boolean getAutoSave() -
getAutoPairing
public boolean getAutoPairing() -
setAutoPairing
public void setAutoPairing(java.lang.String newValue) -
getAutoResize
public boolean getAutoResize() -
getShowLineNumbers
public boolean getShowLineNumbers() -
getOutputFormat
public java.lang.String getOutputFormat() -
getPrompt
public java.lang.String getPrompt() -
getRightPrompt
public java.lang.String getRightPrompt() -
getTrimScripts
public boolean getTrimScripts() -
getKeepSemicolon
public boolean getKeepSemicolon() -
getMaxHeight
public int getMaxHeight() -
getMaxWidth
public int getMaxWidth() -
getMaxColumnWidth
public int getMaxColumnWidth() -
getUseLineContinuation
public boolean getUseLineContinuation() -
getLiveTemplatesFile
public java.lang.String getLiveTemplatesFile() -
setLiveTemplatesFile
public void setLiveTemplatesFile(java.lang.String fileName) -
getMode
public java.lang.String getMode() -
setMode
public void setMode(java.lang.String mode) -
setOutputFormat
public void setOutputFormat(java.lang.String outputFormat) -
setTableStyle
public void setTableStyle(java.lang.String tableStyle) -
getTableStyle
public java.lang.String getTableStyle() -
getStrictJdbc
public boolean getStrictJdbc() -
getPropertiesFile
public java.lang.String getPropertiesFile() -
setPropertiesFile
public void setPropertiesFile(java.lang.String propertyFile) -
setRun
public void setRun(java.lang.String runFile) -
getRun
public java.lang.String getRun() -
getConfirm
public boolean getConfirm() -
getConfirmPattern
public java.lang.String getConfirmPattern() -
setConfirmPattern
public void setConfirmPattern(java.lang.String confirmPattern) -
getCompiledConfirmPattern
public java.util.regex.Pattern getCompiledConfirmPattern() -
getHistoryFlags
public java.lang.String getHistoryFlags() -
getScriptEngine
public java.lang.String getScriptEngine() -
setScriptEngine
public void setScriptEngine(java.lang.String engineName)
-