Incominciamo

E se fosse SQLite?

Prima di cominciare, domandiamoci tre cose: è la prima volta che uso Bauble?, lavorerò su una sola macchina?, non ho intenzione di sporcarmi le mani con la gestione di basi dati? Bene, se abbiamo risposto affermativamente ad almeno una delle precedenti, mi sà che sarebbe meglio restare con SQLite. SQLite è un sistema SQL rapido, semplice, senza amministrazione.

Con SQLite non c’è bisogno di preparare altro e si può proseguire con connecting.

On the other hand, if you want to connect more than one bauble workstation to the same database, or if you want to make your data available for other clients, as could be a web server in a LAMP setting, you should consider keeping your database in a database management system like PostgreSQL or MySQL/MariaDB, both supported by Bauble.

When connecting to a database server as one of the above, you have to manually create: at least one bauble user, the database you want bauble to use, and to give at lest one bauble user full permissions on its database. When this is done, Bauble will be able to proceed, creating the tables and importing the default data set. The process is database-dependent and it falls beyond the scope of this manual.

If you already got the chills or sick at your stomach, no need to worry, just stick with SQLite, you do not miss on features nor performance.

Connettersi ad una base dati

All’avviare Bauble, la prima cosa che appare è la finestra per la scelta della connessione.

Abbastanza naturalmente, la prima volta che si avvia Bauble non ci saranno connessioni a disposizione. Bauble mostra una finestra di avviso.

_images/first-time-activation.png

Come dice lo stesso testo: chiudere la finestra di avviso, Bauble tornerà alla finestra di connessione, dove selezioneremo Add per creare la prima connessione.

_images/enter-a-connection-name.png

Semplicemente: inserire un nome per la connessione, una cose semplice e significativa che si associ naturalmente alla collezione che si vuol inserire (che so, «alberi monumentali»), e scegliere OK. Bauble torna allo schermo precedente, ma il nome della connessione sarà selezionato e la sezione Dettagli della Connessione sarà visibile.

_images/my-first-botanical-garden.png

specificare i dettagli della connessione

If you do not know what to do here, Bauble will help you stay safe. Activate the Use default locations check box and create your first connection by clicking on Connect.

You may safely skip the remainder of this section for the time being and continue reading to the following section.

fine-tune the connection details

By default Bauble uses the file-based SQLite database. During the installation process you had the choice (and you still have after installation), to add database connectors other than the default SQLite.

In this example, Bauble can connect to SQLite, PostgreSQL and MySQL, but no connector is available for Oracle or MS SQL Server.

_images/connection-drop-down.png

If you use SQLite, all you really need specify is the connection name. If you let Bauble use the default filename then Bauble creates a database file with the same name as the connection and .db extension, and a pictures folder with the same name and no extension, both in ~/.bauble on Linux/MacOSX or in AppData\Roaming\Bauble on Windows.

Still with SQLite, you might have received or downloaded a bauble database, and you want to connect to it. In this case you do not let Bauble use the default filename, but you browse in your computer to the location where you saved the Bauble SQLite database file.

If you use a different database connector, the dialog box will look different and it will offer you the option to fine tune all parameters needed to connect to the database of your choice.

If you are connecting to an existing database you can continue to Inserire e modificare dati and subsequently Searching in Bauble, otherwise read on to the following section on initializing a database for Bauble.

If you plan to associate pictures to plants, specify also the pictures root folder. The meaning of this is explained in further detail at Fotografie in Inserire e modificare dati.

Inizializzare la base dati

La prima volta che si apre una connessione ad una base dati che Bauble non ha mai utilizzato prima, Bauble mostrerà l’avviso:

_images/empty-database.png

seguito a ruota da una domanda:

_images/bauble-create-new.png

Be careful when manually specifying the connection parameters: the values you have entered may refer to an existing database, not intended for use with Bauble. By letting Bauble initialize a database, the database will be emptied and all of its content be lost.

If you are sure you want to create a database at this connection then select «Yes». Bauble will then start creating the database tables and importing the default data. This can take a minute or two so while all of the default data is imported into the database so be patient.

Una volta creata, configurata, inizializzata la base dati, siamo pronti per iniziare a editing-and-inserting-data`ed in seguito :ref:`searching-in-bauble.