From 8e640722c62692818ab840d50b3758f89a41a54e Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Wed, 25 Nov 2015 16:48:41 -0500 Subject: Imported Upstream version 3.0.7 --- SQLiteStudio3/sqlitestudiocli/cli.cpp | 29 + SQLiteStudio3/sqlitestudiocli/cli.h | 10 +- .../sqlitestudiocli/clicommandexecutor.cpp | 4 +- .../sqlitestudiocli/commands/clicommanddesc.cpp | 94 +++ .../sqlitestudiocli/commands/clicommanddesc.h | 8 + .../sqlitestudiocli/commands/clicommanduse.cpp | 2 +- SQLiteStudio3/sqlitestudiocli/main.cpp | 5 +- SQLiteStudio3/sqlitestudiocli/sqlitestudiocli.pro | 4 +- .../translations/sqlitestudiocli_de.ts | 68 +- .../translations/sqlitestudiocli_es.ts | 68 +- .../translations/sqlitestudiocli_fr.ts | 70 +- .../translations/sqlitestudiocli_it.ts | 788 +++++++++++++++++++++ .../translations/sqlitestudiocli_pl.ts | 44 ++ .../translations/sqlitestudiocli_pt_BR.ts | 68 +- .../translations/sqlitestudiocli_ru.ts | 72 +- .../translations/sqlitestudiocli_sk.ts | 68 +- .../translations/sqlitestudiocli_zh_CN.ts | 100 ++- 17 files changed, 1422 insertions(+), 80 deletions(-) create mode 100644 SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_it.ts (limited to 'SQLiteStudio3/sqlitestudiocli') diff --git a/SQLiteStudio3/sqlitestudiocli/cli.cpp b/SQLiteStudio3/sqlitestudiocli/cli.cpp index 0f527ac..87c4f93 100644 --- a/SQLiteStudio3/sqlitestudiocli/cli.cpp +++ b/SQLiteStudio3/sqlitestudiocli/cli.cpp @@ -9,12 +9,14 @@ #include "common/utils_sql.h" #include "climsghandler.h" #include "clicompleter.h" +#include "services/notifymanager.h" #include #include #include #include #include #include +#include #if defined(Q_OS_WIN32) #include "readline.h" @@ -36,6 +38,9 @@ CLI::CLI(QObject* parent) : history_base = 0; // for some reason this was set to 1 under Unix, making 1st history entry to be always ommited #endif + connect(NOTIFY_MANAGER, SIGNAL(notifyInfo(QString)), this, SLOT(printInfo(QString))); + connect(NOTIFY_MANAGER, SIGNAL(notifyWarning(QString)), this, SLOT(printWarn(QString))); + connect(NOTIFY_MANAGER, SIGNAL(notifyError(QString)), this, SLOT(printError(QString))); loadHistory(); CliCompleter::getInstance()->init(this); @@ -43,6 +48,7 @@ CLI::CLI(QObject* parent) : CLI::~CLI() { + safe_delete(thread); } CLI* CLI::getInstance() @@ -53,6 +59,11 @@ CLI* CLI::getInstance() return instance; } +void CLI::dispose() +{ + safe_delete(instance); +} + void CLI::start() { thread = new QThread(this); @@ -153,6 +164,24 @@ int CLI::historyLength() const #endif } +void CLI::printWarn(const QString &msg) +{ + static_qstring(tpl, "[WARNING] %1"); + qOut << tpl.arg(msg) << "\n"; +} + +void CLI::printError(const QString &msg) +{ + static_qstring(tpl, "[ERROR] %1"); + qOut << tpl.arg(msg) << "\n"; +} + +void CLI::printInfo(const QString &msg) +{ + static_qstring(tpl, "[INFO] %1"); + qOut << tpl.arg(msg) << "\n"; +} + void CLI::waitForExecution() { executionFinished = false; diff --git a/SQLiteStudio3/sqlitestudiocli/cli.h b/SQLiteStudio3/sqlitestudiocli/cli.h index 6f7c927..12f391b 100644 --- a/SQLiteStudio3/sqlitestudiocli/cli.h +++ b/SQLiteStudio3/sqlitestudiocli/cli.h @@ -20,6 +20,7 @@ class CLI : public QObject ~CLI(); static CLI* getInstance(); + static void dispose(); void start(); void setCurrentDb(Db* db); @@ -48,8 +49,10 @@ class CLI : public QObject bool doExit = false; QString line; - signals: - void execCommand(CliCommand* cmd); + private slots: + void printInfo(const QString& msg); + void printWarn(const QString& msg); + void printError(const QString& msg); public slots: void doWork(); @@ -57,6 +60,9 @@ class CLI : public QObject void executionComplete(); void clearHistory(); void openDbFile(const QString& path); + + signals: + void execCommand(CliCommand* cmd); }; #endif // CLI_H diff --git a/SQLiteStudio3/sqlitestudiocli/clicommandexecutor.cpp b/SQLiteStudio3/sqlitestudiocli/clicommandexecutor.cpp index 6a3072e..66707cc 100644 --- a/SQLiteStudio3/sqlitestudiocli/clicommandexecutor.cpp +++ b/SQLiteStudio3/sqlitestudiocli/clicommandexecutor.cpp @@ -8,7 +8,9 @@ CliCommandExecutor::CliCommandExecutor(QObject *parent) : void CliCommandExecutor::execCommand(CliCommand* cmd) { - connect(cmd, SIGNAL(execComplete()), this, SLOT(asyncExecutionComplete())); + if (cmd->isAsyncExecution()) + connect(cmd, SIGNAL(execComplete()), this, SLOT(asyncExecutionComplete())); + cmd->execute(); if (!cmd->isAsyncExecution()) { diff --git a/SQLiteStudio3/sqlitestudiocli/commands/clicommanddesc.cpp b/SQLiteStudio3/sqlitestudiocli/commands/clicommanddesc.cpp index 4865e23..f32b75e 100644 --- a/SQLiteStudio3/sqlitestudiocli/commands/clicommanddesc.cpp +++ b/SQLiteStudio3/sqlitestudiocli/commands/clicommanddesc.cpp @@ -1,4 +1,8 @@ #include "clicommanddesc.h" +#include "cli.h" +#include "schemaresolver.h" +#include "parser/ast/sqlitecreatevirtualtable.h" +#include "cliutils.h" CliCommandDesc::CliCommandDesc() { @@ -6,7 +10,41 @@ CliCommandDesc::CliCommandDesc() void CliCommandDesc::execute() { + if (!cli->getCurrentDb()) + { + println(tr("No working database is set.\n" + "Call %1 command to set working database.\n" + "Call %2 to see list of all databases.") + .arg(cmdName("use")).arg(cmdName("dblist"))); + return; + } + + Db* db = cli->getCurrentDb(); + if (!db || !db->isOpen()) + { + println(tr("Database is not open.")); + return; + } + + QString table = syntax.getArgument(TABLE); + SchemaResolver resolver(db); + SqliteQueryPtr query = resolver.getParsedObject(table, SchemaResolver::TABLE); + if (!query || (!query.dynamicCast() && !query.dynamicCast())) + { + println(tr("Cannot find table named: %1").arg(table)); + return; + } + + SqliteCreateTablePtr createTable = query.dynamicCast(); + if (createTable) + { + printTable(createTable.data()); + return; + } + + SqliteCreateVirtualTablePtr virtualTable = query.dynamicCast(); + printVirtualTable(virtualTable.data()); } QString CliCommandDesc::shortHelp() const @@ -24,3 +62,59 @@ void CliCommandDesc::defineSyntax() syntax.setName("desc"); syntax.addArgument(TABLE, tr("table")); } + +void CliCommandDesc::printTable(SqliteCreateTable *table) +{ + int termCols = getCliColumns(); + println(pad("", termCols, '-')); + println(tr("Table: %1").arg(table->table)); + + // Header + QString msg; + msg = pad(tr("Column name"), 20, ' '); + msg += "|"; + msg += pad(tr("Data type"), 10, ' '); + msg += "|"; + int lgt3rd = termCols - msg.length(); + printHorizontalLine(lgt3rd); + msg += pad(tr("Constraints"), lgt3rd, ' '); + println(msg); + printHorizontalLine(lgt3rd); + + // Rows + QString constrJoinStr = "\n" + pad("", 20, ' ') + "|" + pad("", 10, ' ') + "|"; + QStringList constrList; + for (SqliteCreateTable::Column* column : table->columns) + { + msg = pad(column->name.left(20), 20, ' '); + msg += "|"; + msg += pad((column->type ? column->type->detokenize().left(10) : ""), 10, ' '); + msg += "|"; + + constrList.clear(); + for (SqliteCreateTable::Column::Constraint* constr : column->constraints) + constrList << pad(constr->detokenize().left(lgt3rd), lgt3rd, ' '); + + msg += constrList.join(constrJoinStr); + println(msg); + } +} + +void CliCommandDesc::printVirtualTable(SqliteCreateVirtualTable *table) +{ + println(tr("Virtual table: %1").arg(table->table)); + if (table->args.size() > 0) + { + int i = 1; + println(tr("Construction arguments:")); + for (const QString& arg : table->args) + println(pad(QString::number(i++), 2, ' ') + ". " + arg); + } + else + println(tr("No construction arguments were passed for this virtual table.")); +} + +void CliCommandDesc::printHorizontalLine(int lgt3rd) +{ + println(pad("", 20, '-') + "+" + pad("", 10, '-') + "+" + pad("", lgt3rd, '-')); +} diff --git a/SQLiteStudio3/sqlitestudiocli/commands/clicommanddesc.h b/SQLiteStudio3/sqlitestudiocli/commands/clicommanddesc.h index 46876df..3c06c6a 100644 --- a/SQLiteStudio3/sqlitestudiocli/commands/clicommanddesc.h +++ b/SQLiteStudio3/sqlitestudiocli/commands/clicommanddesc.h @@ -3,6 +3,9 @@ #include "clicommand.h" +class SqliteCreateTable; +class SqliteCreateVirtualTable; + class CliCommandDesc : public CliCommand { Q_OBJECT @@ -13,6 +16,11 @@ class CliCommandDesc : public CliCommand QString shortHelp() const; QString fullHelp() const; void defineSyntax(); + + private: + void printTable(SqliteCreateTable* table); + void printVirtualTable(SqliteCreateVirtualTable* table); + void printHorizontalLine(int lgt3rd); }; #endif // CLICOMMANDDESC_H diff --git a/SQLiteStudio3/sqlitestudiocli/commands/clicommanduse.cpp b/SQLiteStudio3/sqlitestudiocli/commands/clicommanduse.cpp index ef0f641..9706221 100644 --- a/SQLiteStudio3/sqlitestudiocli/commands/clicommanduse.cpp +++ b/SQLiteStudio3/sqlitestudiocli/commands/clicommanduse.cpp @@ -6,7 +6,7 @@ void CliCommandUse::execute() { - if (syntax.isArgumentSet(DB_NAME)) + if (!syntax.isArgumentSet(DB_NAME)) { if (!cli->getCurrentDb()) { diff --git a/SQLiteStudio3/sqlitestudiocli/main.cpp b/SQLiteStudio3/sqlitestudiocli/main.cpp index 4bec619..eb7a46e 100644 --- a/SQLiteStudio3/sqlitestudiocli/main.cpp +++ b/SQLiteStudio3/sqlitestudiocli/main.cpp @@ -90,6 +90,7 @@ int main(int argc, char *argv[]) CLI::getInstance()->openDbFile(dbToOpen); CLI::getInstance()->start(); - - return a.exec(); + int res = a.exec(); + CLI::dispose(); + return res; } diff --git a/SQLiteStudio3/sqlitestudiocli/sqlitestudiocli.pro b/SQLiteStudio3/sqlitestudiocli/sqlitestudiocli.pro index 4e3bae0..705a00c 100644 --- a/SQLiteStudio3/sqlitestudiocli/sqlitestudiocli.pro +++ b/SQLiteStudio3/sqlitestudiocli/sqlitestudiocli.pro @@ -27,7 +27,8 @@ linux { } } -TRANSLATIONS += translations/sqlitestudiocli_zh_CN.ts \ +TRANSLATIONS += translations/sqlitestudiocli_it.ts \ + translations/sqlitestudiocli_zh_CN.ts \ translations/sqlitestudiocli_sk.ts \ translations/sqlitestudiocli_de.ts \ translations/sqlitestudiocli_ru.ts \ @@ -124,3 +125,4 @@ RESOURCES += \ + diff --git a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_de.ts b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_de.ts index 9dee56c..f544581 100644 --- a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_de.ts +++ b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_de.ts @@ -4,32 +4,32 @@ CLI - + Current database: %1 - + No current working database is set. - + Type %1 for help - + Database passed in command line parameters (%1) was already on the list under name: %2 - + Could not add database %1 to list. - + closed @@ -201,15 +201,67 @@ CliCommandDesc - + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + + + + + Database is not open. + + + + + Cannot find table named: %1 + + + + shows details about the table - + table + + + Table: %1 + + + + + Column name + + + + + Data type + + + + + Constraints + + + + + Virtual table: %1 + + + + + Construction arguments: + + + + + No construction arguments were passed for this virtual table. + + CliCommandDir diff --git a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_es.ts b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_es.ts index d446494..7d3b5c5 100644 --- a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_es.ts +++ b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_es.ts @@ -4,32 +4,32 @@ CLI - + Current database: %1 - + No current working database is set. - + Type %1 for help - + Database passed in command line parameters (%1) was already on the list under name: %2 - + Could not add database %1 to list. - + closed @@ -201,15 +201,67 @@ CliCommandDesc - + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + + + + + Database is not open. + + + + + Cannot find table named: %1 + + + + shows details about the table - + table + + + Table: %1 + + + + + Column name + + + + + Data type + + + + + Constraints + + + + + Virtual table: %1 + + + + + Construction arguments: + + + + + No construction arguments were passed for this virtual table. + + CliCommandDir diff --git a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_fr.ts b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_fr.ts index 5096d8c..cdcfb5b 100644 --- a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_fr.ts +++ b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_fr.ts @@ -4,32 +4,32 @@ CLI - + Current database: %1 Base de données actuelle: %1 - + No current working database is set. Aucune base de données en cours n'est activée. - + Type %1 for help Touche %1 pour l'aide - + Database passed in command line parameters (%1) was already on the list under name: %2 - + Could not add database %1 to list. Impossible d'ajouter la base de données %1 à la liste. - + closed Fermé @@ -201,15 +201,69 @@ CliCommandDesc - + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + Aucune base de données de travail n'est activée. +Appelez la commande %1 pour activer la base de données active. +Appelez %2 pour voir la liste de toutes les bases de données. + + + + Database is not open. + La base de données n'est pas ouverte. + + + + Cannot find table named: %1 + + + + shows details about the table Affichage des détails de la table - + table Table + + + Table: %1 + + + + + Column name + + + + + Data type + + + + + Constraints + + + + + Virtual table: %1 + + + + + Construction arguments: + + + + + No construction arguments were passed for this virtual table. + + CliCommandDir diff --git a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_it.ts b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_it.ts new file mode 100644 index 0000000..959e194 --- /dev/null +++ b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_it.ts @@ -0,0 +1,788 @@ + + + + + CLI + + + Current database: %1 + + + + + No current working database is set. + + + + + Type %1 for help + + + + + Database passed in command line parameters (%1) was already on the list under name: %2 + + + + + Could not add database %1 to list. + + + + + closed + + + + + CliCommand + + + Usage: %1%2 + + + + + CliCommandAdd + + + Could not add database %1 to list. + + + + + Database added: %1 + + + + + adds new database to the list + + + + + Adds given database pointed by <path> with given <name> to list the databases list. The <name> is just a symbolic name that you can later refer to. Just pick any unique name. For list of databases already on the list use %1 command. + + + + + name + CLI command syntax + + + + + path + CLI command syntax + + + + + CliCommandCd + + + Changed directory to: %1 + + + + + Could not change directory to: %1 + + + + + changes current working directory + + + + + Very similar command to 'cd' known from Unix systems and Windows. It requires a <path> argument to be passed, therefore calling %1 will always cause a change of the directory. To learn what's the current working directory use %2 command and to list contents of the current working directory use %3 command. + + + + + path + CLI command syntax + + + + + CliCommandClose + + + Cannot call %1 when no database is set to be current. Specify current database with %2 command or pass database name to %3. + + + + + + Connection to database %1 closed. + + + + + No such database: %1. Use %2 to see list of known databases. + + + + + closes given (or current) database + + + + + Closes database connection. If the database was already closed, nothing happens. If <name> is provided, it should be name of the database to close (as printed by %1 command). The the <name> is not provided, then current working database is closed (see help for %2 for details). + + + + + name + CLI command syntax + + + + + CliCommandDbList + + + No current working database defined. + + + + + Databases: + + + + + + Name + CLI db name column + + + + + + Open + CLI connection state column + + + + + + Closed + CLI connection state column + + + + + + Connection + CLI connection state column + + + + + + Database file path + + + + + prints list of registered databases + + + + + Prints list of databases registered in the SQLiteStudio. Each database on the list can be in open or closed state and %1 tells you that. The current working database (aka default database) is also marked on the list with '*' at the start of its name. See help for %2 command to learn about the default database. + + + + + CliCommandDesc + + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + + + + + Database is not open. + + + + + Cannot find table named: %1 + + + + + shows details about the table + + + + + table + + + + + Table: %1 + + + + + Column name + + + + + Data type + + + + + Constraints + + + + + Virtual table: %1 + + + + + Construction arguments: + + + + + No construction arguments were passed for this virtual table. + + + + + CliCommandDir + + + lists directories and files in current working directory + + + + + This is very similar to 'dir' command known from Windows and 'ls' command from Unix systems. + +You can pass <pattern> with wildcard characters to filter output. + + + + + pattern + + + + + CliCommandExit + + + quits the application + + + + + Quits the application. Settings are stored in configuration file and will be restored on next startup. + + + + + CliCommandHelp + + + shows this help message + + + + + Use %1 to learn about certain commands supported by the command line interface (CLI) of the SQLiteStudio. +To see list of supported commands, type %2 without any arguments. + +When passing <command> name, you can skip special prefix character ('%3'). + +You can always execute any command with exactly single '--help' option to see help for that command. It's an alternative for typing: %1 <command>. + + + + + command + CLI command syntax + + + + + No such command: %1 + + + + + Type '%1' for list of available commands. + + + + + Usage: %1%2 + + + + + Aliases: %1 + + + + + CliCommandHistory + + + Current history limit is set to: %1 + + + + + prints history or erases it + + + + + When no argument was passed, this command prints command line history. Every history entry is separated with a horizontal line, so multiline entries are easier to read. + +When the -c or --clear option is passed, then the history gets erased. +When the -l or --limit option is passed, it sets the new history entries limit. It requires an additional argument saying how many entries do you want the history to be limited to. +Use -ql or --querylimit option to see the current limit value. + + + + + number + + + + + Console history erased. + + + + + Invalid number: %1 + + + + + History limit set to %1 + + + + + CliCommandMode + + + Current results printing mode: %1 + + + + + Invalid results printing mode: %1 + + + + + New results printing mode: %1 + + + + + tells or changes the query results format + + + + + When called without argument, tells the current output format for a query results. When the <mode> is passed, the mode is changed to the given one. Supported modes are: +- CLASSIC - columns are separated by a comma, not aligned, +- FIXED - columns have equal and fixed width, they always fit into terminal window width, but the data in columns can be cut off, +- COLUMNS - like FIXED, but smarter (do not use with huge result sets, see details below), +- ROW - each column from the row is displayed in new line, so the full data is displayed. + +The CLASSIC mode is recommended if you want to see all the data, but you don't want to waste lines for each column. Each row will display full data for every column, but this also means, that columns will not be aligned to each other in next rows. The CLASSIC mode also doesn't respect the width of your terminal (console) window, so if values in columns are wider than the window, the row will be continued in next lines. + +The FIXED mode is recommended if you want a readable output and you don't care about long data values. Columns will be aligned, making the output a nice table. The width of columns is calculated from width of the console window and a number of columns. + +The COLUMNS mode is similar to FIXED mode, except it tries to be smart and make columns with shorter values more thin, while columns with longer values get more space. First to shrink are columns with longest headers (so the header names are to be cut off as first), then columns with the longest values are shrinked, up to the moment when all columns fit into terminal window. +ATTENTION! The COLUMNS mode reads all the results from the query at once in order to evaluate column widhts, therefore it is dangerous to use this mode when working with huge result sets. Keep in mind that this mode will load entire result set into memory. + +The ROW mode is recommended if you need to see whole values and you don't expect many rows to be displayed, because this mode displays a line of output per each column, so you'll get 10 lines for single row with 10 columns, then if you have 10 of such rows, you will get 100 lines of output (+1 extra line per each row, to separate rows from each other). + + + + + CliCommandNullValue + + + Current NULL representation string: %1 + + + + + tells or changes the NULL representation string + + + + + If no argument was passed, it tells what's the current NULL value representation (that is - what is printed in place of NULL values in query results). If the argument is given, then it's used as a new string to be used for NULL representation. + + + + + CliCommandOpen + + + Cannot call %1 when no database is set to be current. Specify current database with %2 command or pass database name to %3. + + + + + Could not add database %1 to list. + + + + + File %1 doesn't exist in %2. Cannot open inexisting database with %3 command. To create a new database, use %4 command. + + + + + Database %1 has been open and set as the current working database. + + + + + opens database connection + + + + + Opens connection to the database. If no additional argument was passed, then the connection is open to the current default database (see help for %1 for details). However if an argument was passed, it can be either <name> of the registered database to open, or it can be <path> to the database file to open. In the second case, the <path> gets registered on the list with a generated name, but only for the period of current application session. After restarting application such database is not restored on the list. + + + + + name + CLI command syntax + + + + + path + CLI command syntax + + + + + CliCommandPwd + + + prints the current working directory + + + + + This is the same as 'pwd' command on Unix systems and 'cd' command without arguments on Windows. It prints current working directory. You can change the current working directory with %1 command and you can also list contents of the current working directory with %2 command. + + + + + CliCommandRemove + + + No such database: %1 + + + + + Database removed: %1 + + + + + New current database set: + + + + + removes database from the list + + + + + Removes <name> database from the list of registered databases. If the database was not on the list (see %1 command), then error message is printed and nothing more happens. + + + + + name + CLI command syntax + + + + + CliCommandSql + + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + + + + + Database is not open. + + + + + executes SQL query + + + + + This command is executed every time you enter SQL query in command prompt. It executes the query on the current working database (see help for %1 for details). There's no sense in executing this command explicitly. Instead just type the SQL query in the command prompt, without any command prefixed. + + + + + sql + CLI command syntax + + + + + + Too many columns to display in %1 mode. + + + + + Row %1 + + + + + Query execution error: %1 + + + + + CliCommandTables + + + No such database: %1. Use %2 to see list of known databases. + + + + + Cannot call %1 when no database is set to be current. Specify current database with %2 command or pass database name to %3. + + + + + Database %1 is closed. + + + + + + Database + + + + + Table + + + + + prints list of tables in the database + + + + + Prints list of tables in given <database> or in the current working database. Note, that the <database> should be the name of the registered database (see %1). The output list includes all tables from any other databases attached to the queried database. +When the -s option is given, then system tables are also listed. + + + + + database + CLI command syntax + + + + + CliCommandTree + + + No current working database is selected. Use %1 to define one and then run %2. + + + + + Tables + + + + + Views + + + + + Columns + + + + + Indexes + + + + + + Triggers + + + + + prints all objects in the database as a tree + + + + + Prints all objects (tables, indexes, triggers and views) that are in the database as a tree. The tree is very similar to the one that you can see in GUI client of the SQLiteStudio. +When -c option is given, then also columns will be listed under each table. +When -s option is given, then also system objects will be printed (sqlite_* tables, autoincrement indexes, etc). +The database argument is optional and if provided, then only given database will be printed. This is not a registered database name, but instead it's an internal SQLite database name, like 'main', 'temp', or any attached database name. To print tree for other registered database, call %1 first to switch the working database, and then use %2 command. + + + + + CliCommandUse + + + No current database selected. + + + + + + Current database: %1 + + + + + No such database: %1 + + + + + changes default working database + + + + + Changes current working database to <name>. If the <name> database is not registered in the application, then the error message is printed and no change is made. + +What is current working database? +When you type a SQL query to be executed, it is executed on the default database, which is also known as the current working database. Most of database-related commands can also work using default database, if no database was provided in their arguments. The current database is always identified by command line prompt. The default database is always defined (unless there is no database on the list at all). + +The default database can be selected in various ways: +- using %1 command, +- by passing database file name to the application startup parameters, +- by passing registered database name to the application startup parameters, +- by restoring previously selected default database from saved configuration, +- or when default database was not selected by any of the above, then first database from the registered databases list becomes the default one. + + + + + name + CLI command syntax + + + + + QObject + + + Insufficient number of arguments. + + + + + Too many arguments. + + + + + Invalid argument value: %1. +Expected one of: %2 + + + + + Unknown option: %1 + CLI command syntax + + + + + Option %1 requires an argument. + CLI command syntax + + + + + string + CLI command syntax + + + + + Command line interface to SQLiteStudio, a SQLite manager. + + + + + Enables debug messages on standard error output. + + + + + Enables Lemon parser debug messages for SQL code assistant. + + + + + Lists plugins installed in the SQLiteStudio and quits. + + + + + file + + + + + Database file to open + + + + diff --git a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_pl.ts b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_pl.ts index c7bdf0f..9a0f67b 100644 --- a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_pl.ts +++ b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_pl.ts @@ -169,6 +169,50 @@ table tabela + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + Nie wybrano domyślnej bazy danych. +Użyj polecenia %1, aby ustawić domyślną bazę danych. +Użyj polecenie %2, aby wypisać listę wszystkich baz. + + + Database is not open. + Baz danych nie jest otwarta. + + + Cannot find table named: %1 + + + + Table: %1 + + + + Column name + + + + Data type + + + + Constraints + + + + Virtual table: %1 + + + + Construction arguments: + + + + No construction arguments were passed for this virtual table. + + CliCommandDir diff --git a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_pt_BR.ts b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_pt_BR.ts index 5b92d37..0d46151 100644 --- a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_pt_BR.ts +++ b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_pt_BR.ts @@ -4,32 +4,32 @@ CLI - + Current database: %1 - + No current working database is set. - + Type %1 for help - + Database passed in command line parameters (%1) was already on the list under name: %2 - + Could not add database %1 to list. - + closed @@ -201,15 +201,67 @@ CliCommandDesc - + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + + + + + Database is not open. + + + + + Cannot find table named: %1 + + + + shows details about the table - + table + + + Table: %1 + + + + + Column name + + + + + Data type + + + + + Constraints + + + + + Virtual table: %1 + + + + + Construction arguments: + + + + + No construction arguments were passed for this virtual table. + + CliCommandDir diff --git a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_ru.ts b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_ru.ts index 0cbe067..ef35f51 100644 --- a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_ru.ts +++ b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_ru.ts @@ -1,35 +1,35 @@ - + CLI - + Current database: %1 Текущая база данных: %1 - + No current working database is set. Текущая рабочая база данных не определена. - + Type %1 for help Введите %1 для вызова справки - + Database passed in command line parameters (%1) was already on the list under name: %2 База данных, переданная через аргументы командной строки (%1), уже находится в списке под именем %2 - + Could not add database %1 to list. Невозможно добавить базу данных %1 в список. - + closed закрыта @@ -201,15 +201,69 @@ CliCommandDesc - + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + Не указана рабочая база данных. +Укажите рабочую базу данных командой %1. +Для просмотра списка баз данных воспользуйтесь командой %2. + + + + Database is not open. + База данных не открыта. + + + + Cannot find table named: %1 + Не удалось найти таблицу с именем %1 + + + shows details about the table отображает сведения о таблице - + table таблица + + + Table: %1 + Таблица: %1 + + + + Column name + Имя столбца + + + + Data type + Тип данных + + + + Constraints + Ограничения + + + + Virtual table: %1 + Виртуальная таблица: %1 + + + + Construction arguments: + Параметры создания: + + + + No construction arguments were passed for this virtual table. + Не указаны параметры создания для этой виртуальной таблицы. + CliCommandDir diff --git a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_sk.ts b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_sk.ts index df9da22..e799908 100644 --- a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_sk.ts +++ b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_sk.ts @@ -4,32 +4,32 @@ CLI - + Current database: %1 - + No current working database is set. - + Type %1 for help - + Database passed in command line parameters (%1) was already on the list under name: %2 - + Could not add database %1 to list. - + closed @@ -201,15 +201,67 @@ CliCommandDesc - + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + + + + + Database is not open. + + + + + Cannot find table named: %1 + + + + shows details about the table - + table + + + Table: %1 + + + + + Column name + + + + + Data type + + + + + Constraints + + + + + Virtual table: %1 + + + + + Construction arguments: + + + + + No construction arguments were passed for this virtual table. + + CliCommandDir diff --git a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_zh_CN.ts b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_zh_CN.ts index 4dd7f0a..71b2ea2 100644 --- a/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_zh_CN.ts +++ b/SQLiteStudio3/sqlitestudiocli/translations/sqlitestudiocli_zh_CN.ts @@ -4,34 +4,34 @@ CLI - + Current database: %1 - + 当前数据库:%1 - + No current working database is set. - + 当前没有选定工作数据库。 - + Type %1 for help - + 输入 %1 获取帮助 - + Database passed in command line parameters (%1) was already on the list under name: %2 - + Could not add database %1 to list. - + 未能将数据库“%1”添加到列表。 - + closed - + 已关闭 @@ -39,7 +39,7 @@ Usage: %1%2 - + 用法: %1%2 @@ -47,12 +47,12 @@ Could not add database %1 to list. - + 未能将数据库“%1”添加到列表。 Database added: %1 - + 已添加数据库:%1 @@ -68,7 +68,7 @@ name CLI command syntax - + @@ -82,12 +82,12 @@ Changed directory to: %1 - + 已切换到:%1 Could not change directory to: %1 - + 未能切换到:%1 @@ -201,13 +201,65 @@ CliCommandDesc - - shows details about the table + + No working database is set. +Call %1 command to set working database. +Call %2 to see list of all databases. + + + + + Database is not open. - + + Cannot find table named: %1 + + + + + shows details about the table + 显示表的详情 + + + table + + + + + Table: %1 + + + + + Column name + + + + + Data type + + + + + Constraints + + + + + Virtual table: %1 + + + + + Construction arguments: + + + + + No construction arguments were passed for this virtual table. @@ -236,7 +288,7 @@ You can pass <pattern> with wildcard characters to filter output. quits the application - + 退出本程序 @@ -280,7 +332,7 @@ You can always execute any command with exactly single '--help' option Usage: %1%2 - + 用法: %1%2 @@ -399,7 +451,7 @@ The ROW mode is recommended if you need to see whole values and you don't e Could not add database %1 to list. - + 未能将数据库“%1”添加到列表。 @@ -632,7 +684,7 @@ The database argument is optional and if provided, then only given database will Current database: %1 - + 当前数据库:%1 -- cgit v1.2.3