📄 eqtusersguide.tex
字号:
\documentclass[a4paper]{article}\usepackage{graphicx}\usepackage{ucs}\usepackage{html}\title{Emdros Query Tool User's Guide -- Version 3.1.0}\author{Ulrik Petersen}\begin{document}\newenvironment{precode} {\begin{list}{}{ \setlength{\rightmargin}{\leftmargin} \setlength{\listparindent}{0pt}% needed for AMS classes \raggedright \setlength{\itemsep}{0pt} \setlength{\parsep}{0pt} \normalfont\ttfamily}% \item[]} {\end{list}}\maketitle\tableofcontents\section{Introduction}This is a short User's Guide to the Emdros Query Tool (aka eqt).The Emdros Query Tool reads MQL queries and gives back the resultsin a way that makes sense in the context of {\em your}database.\subsection{Origins of the query tool}The original algorithms for the Emdros Query Tool were written by{\bf Hendrik Jan Bosman} in Python. Thus he is the realfather of the Emdros Query Tool. The algorithms were rewritten in C++by Ulrik Petersen.\subsection{This Guide}This User's Guide is divided into four parts:\begin{enumerate} \item This introduction, which explains how to get started, \item Graphical version User's Guide \item Configuration of the program \item Query Guide (including the MQL Cheat Sheet)\end{enumerate}\subsection{PCRE Library}Regular expression support is provided by the PCRE library package,which is open source software, written by Philip Hazel, and copyrightby the University of Cambridge, England.PCRE can be downloaded from:\begin{center}ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/\end{center}\subsection{Three versions}The Emdros Query Tool exists in three versions:\begin{itemize} \item A command-line version ({\bf eqtc}) \item Two graphical versions: \begin{itemize} \item A non-Unicode version ({\bf eqt}) \item A Unicode-aware version ({\bf eqtu}) \end{itemize}\end{itemize}The next page explains how to get started with either of theseversions.\subsection{Getting started}\subsubsection{Introduction} Before running the Emdros Query Tool for the first time on adatabase, you need to write a configuration file that matches yourdatabase. This is a one-off thing: Once it's done, you don't need tobother with it any more.\subsubsection{Sample configuration file}A number of sample configuration files are supplied with Emdros.You can use these as a starting point for writing your ownconfiguration file.One supplied configuration file is called "default.cfg", whileanother is called "wihebrew.cfg". You can search for these on yourcomputer to locate where they are, or see the manual page for eqt toknow where they are installed (on Windows, they are installed in%EMDROSINSTALLPREFIX%$\backslash$etc$\backslash$). \subsubsection{Full details}The "default.cfg" file is almost self-documenting. However, youcan get more information about the details of the configuration filehere:\begin{itemize} \item Configuring the program\end{itemize}\subsection{Command-line version}After you've written the configuration file, you can then proceedto running the Emdros query tool, like this:\begin{verbatim}eqtc -c <your-config-file> myquery.mql\end{verbatim}For example:\begin{verbatim}eqtc -c myconfigfile.cfg myquery.mql\end{verbatim}\subsubsection{Saving the output}The results will be printed on standard output, so you can redirectthat to a file for later viewing:\begin{verbatim}eqtc -c <your-config-file> myquery.mql > myoutput.txt\end{verbatim}\subsubsection{More options}If using MySQL or PostgreSQL, you may need to pass a passwordto the program. Do this with the -p option.You may also need to pass a database username (-u) or the name of thedatabase host computer (-h). For example:\begin{verbatim}eqtc -c <your-config-file> -u <dbuser> -p <password> -h <dbhost> myquery.mql\end{verbatim}To get a list of supported options, run eqtc with the "--help"switch:\begin{verbatim}eqtc --help\end{verbatim}\section{Graphical version User's Guide}This section of the Emdros Query Tool User's Guide shows how to usethe graphical versions of the Emdros Query Tool.\subsection{Starting the program}\subsubsection{Getting started}Once you open the program, you will be presented with the mainscreen. You will then need to "connect" to a database. Either choosethe menu-item "Tools$|$New database connection" or press the button \includegraphics[scale=0.5]{connect.png} "Connect to database".\subsubsection{Connection dialog}You will then be given a dialog box allowing you to choose theConnection Settings. At the top is a drop-down box allowing you tochoose the backend. Based on this choice, the dialog box will appearslightly differently depending whether the backend is:\begin{itemize} \item SQLite, or \item MySQL or PostgreSQL\end{itemize} \subsubsection{Non-Unicode vs. Unicode}For each backend, the program exists in two versions:\begin{itemize} \item A non-Unicode version ({\bf eqt}) \item A Unicode-aware version ({\bf eqtu})\end{itemize}Note that on Linux/Unix, eqtu may in fact be called eqt, replacingthe non-Unicode version. This occurs if the installed wxWidgets usesUnicode by default.\subsubsection{SQLite version}The Connection Settings dialog looks like this if you have selectedSQLite as the backend:\includegraphics[scale=0.5]{SQLiteConnSettings.png}\paragraph{Set the configuration file}The first thing you should do is press the "Browse" button next tothe "Configuration" edit box, then navigate to where you have yourconfiguration file.Once you've opened the configuration file, the "database" fieldwill be filled from the "database" value stored in the configurationfile, if any. If this is not the database you want, simply enter (orbrowse for) the database you want.For example:\includegraphics[scale=0.5]{SQLiteConnSettingsFilled.png}\paragraph{Press OK}Once you're done setting the configuration file and the database,press "OK". If you want to quit the program instead, press"Cancel".\subsubsection{MySQL/PostgreSQL version}When you start the Emdros Query Tool using the MySQL or the PostgreSQL backend, you will see this dialog:\includegraphics[scale=0.5]{MyPgSQLConnSettings.png}\paragraph{Set the configuration file}The first thing you should do is press the "Browse" button next tothe "Configuration" edit box, then navigate to where you have yourconfiguration file.\paragraph{Database}Once you've opened the configuration file, the "database" fieldwill be filled from the "database" value stored in the configurationfile, if any. If this is not the database you want, simply enter thedatabase you want.\paragraph{Host, user, password}Most people can leave the "host" and "user" fields as they are, andsimply write the password.The "host" field shows which computer to connect to, i.e., thecomputer where the MySQL or PostgreSQL backend is running. "localhost"means the computer where eqt(u) is running.The "user" field is the database user to connect to the backend as.Note that this may be different from your computer user name. Thedefault is "emdf", since that is the recommended default user tocreate when you bootstrap the MySQL or PostgreSQL database (see"bootstrapping.txt" in the Emdrosdocumentation).The "password" field is for the password of the database user toconnect as. This is set either by the database administrator, or bythe one who bootstrapped the MySQL or PostgreSQL database.\paragraph{Example}\includegraphics[scale=0.5]{MyPgConnSettingsFilled.png}\paragraph{Press OK}Once you're done setting the configuration file and the database,press "OK". If you want to quit the program instead, press"Cancel".\subsection{The main screen}Once you've pressed "OK" on the "Connection settings" dialog box,you will see the main screen:\includegraphics[scale=0.5]{MainScreen.png}\subsubsection{Parts}The main screen consist of these parts:\begin{itemize} \item A menu at the top. \includegraphics[scale=0.5]{MenuBar.png} \item Below that, a toolbar with buttons. \includegraphics[scale=0.5]{ToolBar.png} \item Below that, three areas: \begin{itemize} \item To the right, a collapsible tree that shows the database schema \item In the top half of the left side, the input area, where you write your queries and your configuration files. \item In the lower half of the left side, the output area, where the output from queries will be written. \end{itemize}\end{itemize}\subsubsection{Next}Next, we describe each of these parts.\subsubsection{Toolbar}The toolbar looks like this:\includegraphics[scale=0.5]{ToolBar.png}The buttons represent actions, each of which will be explainedbelow.\paragraph{New, Open, Save}{\bf New}\ \includegraphics[scale=0.5]{new.png}\ :Clears the input and output areas to "start afresh".{\bf Open}\ \includegraphics[scale=0.5]{open.png}\ :Opens a file (a query or a configuration file). {\bf Save}\ \includegraphics[scale=0.5]{save.png}\ :Saves the current file.\paragraph{Copy, Cut, Paste}{\bf Copy}\ \includegraphics[scale=0.5]{copy.png}\ :Copies the current selection to the clipboard. Works for both theinput area and the output areaoutput area.{\bf Cut}\ \includegraphics[scale=0.5]{cut.png}\ : Cutsthe current selection to the clipboard. Works for both theinput area and the output areaoutput area.{\bf Paste}\ \includegraphics[scale=0.5]{paste.png}\ : Pastes the current clipboard contents. Works forboth the input area and theoutput area.\paragraph{Execute, Stop}{\bf Execute}\ \includegraphics[scale=0.5]{flash.png}\ : Executes the query in the input area.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -