It's yet another unique capability of the Aginity platform that reflects our philosophy's most important aspect. This feature allows you to easily create, save, access, reuse, manage, and share catalogs and items stored in them with your colleagues. Your entire team can use the same queries, templates, and catalogs for different purposes and share code changes in seconds. Aginity catalogs have various types of items and very intuitive navigation.
How to Navigate Query Catalog
- To start browsing it, go to the left sidebar ⇨ Click on the Catalog tab, and you will see its menu field.
- You can also find a particular Catalog via our Discovery Panel.
🔎 TIP: For details, check out our guide on how to use Discovery Panel.
- To check key metadata items and statistics about a Catalog, right-click on its query and tap on Edit Details.
Adding Items to Catalog
- Aginity gives you the ability to create Catalog items from scratch – either New Entry or New Folder.
There are two ways to do it:
- Directly from the Catalog Browser by clicking the (…) symbol on the right from the Catalog
- Right-click in Catalog Browser and select what you would like to add.
- When you're adding entries, fill in the details in a pop-up and choose a type of Catalog entry you want to create.
- You can organize your Catalog by any number of directories and sub-directories of queries and give each query a proper name, as shown below.
- To access and edit queries, use one of these options:
- Drag a catalog query into an empty query panel, as shown below. After that, you will see the full catalog query available for editing or execution.
- To edit queries (e.g., change the SQL itself) within a query panel, right-click on a catalog item and choose Edit code in tab. Or double left-click on a query, and Aginity will open it in a tab.
- To save an edited query:
- Right-click on its tab and select Save Tab.
🔎 NOTE: If you see a (*) symbol next to the tab name in a query panel,
it means a change has not been saved.
- You can also directly select a part/section/lines of SQL statement(s) in a query panel worksheet. It creates a new tab that you can save to a new Catalog, as shown below. Just click on Save Selection to Catalog and provide metadata about a query you are adding in a New Catalog Item pop-up.
🔎 NOTE: It's important to fill out the description metadata as the search engine will use it.
The more data you provide about the usage context and key business terms,
the better search results you will get.
Using Parameters in Catalog SQL
We consider it as one of the most innovative Aginity features. Below, you will find a helpful insight about the basic syntax required to call Catalog items from within SQL statements.
In this example, we use a parameter within a Catalog item called CitySelect.
- Here is the code you need for the Catalog. Note that the highlighted line has the parameter in it.
WHERE city = $city;
- To call it from the query panel, issue the following command.
Note the highlighted reference to the object in the Catalog.
- This is the code that Aginity will pass to the database.
WHERE city = 'Chicago';
🔎 NOTE: Upon execution of the command, Aginity will ask you to supply a parameterized value.
How to Create Reference and What Does it Mean
Creating a Reference means that you can take a part of the code from some query and insert it in another one without the need to copy-paste. You just refer to it via a special link. The most important benefit of this feature is that when you edit something in a part of code you referred to, Aginity will automatically update its SQL in all catalogs that use it.
- You can insert a reference to a Catalog directly in a query. Right-click on the needed query ⇨ Choose Insert Reference at Cursor.
- Or refer to a Catalog through Aginity Discovery Panel.
🔎 TIP: To know more, visit our Discovery Panel guide.
Import and Export Items from Catalog
In Aginity, you can import and export both your entire catalogs or any folders selected within them.
- To export your items or Catalog, you can use several options:
- Right-click on a Catalog folder and select Export.
- Or click on the (…) symbol on the right from the Catalog header ⇨ Choose Export Catalog.
- Go to File tab ⇨ Select Export Catalog.
- In an Export Catalog pop-up, choose what you want to save — an entire folder or a selection of items within it. And specify whether you wish to include Sensitive Data.
- Name the file and set the location to where you will save it.
🔎 NOTE: We highly recommend regularly export your catalogs to portable
data storage devices to prevent accidental loss of queries.
With importing, you can restore catalog items you may have lost and collaborate with other engineers by sharing your SQL. In turn, it might help make you a more efficient and consistent SQL developer.
- To import your items or Catalog, you can use the following options:
- Right-click on a designated folder and select Import.
- Or click on the (…) symbol on the right from the Catalog header ⇨ Choose Import Catalog.
- Go to File tab ⇨ select Import Catalog
- Pick the files/items you want to import. By default, Aginity Catalog files have the .aginitypkg extension.
- Tap the Import button, and you are all set.
🔎 TIP: Aginity also maintains a Github repository of available catalog queries.
They are either administrative queries for specific platforms,
data engineering queries that do powerful transformations against generic data,
or analytic queries showing how to do cool things in SQL.
How to Share Catalogs (in Aginity Premium)
The greatest advantage of our application's Premium version is that you can easily and quickly share queries and catalogs with the selected users. This accelerates communication between teammates, for example, and speeds up catalogs' management and reuse significantly.
- To get started, right-click on the designated folder ⇨ Choose Share.
- Select the Type of sharing you need — for individual users or a group of them. You can also filter available users by typing in their names.
- Specify the Access Level you want to grant to those you're sharing a Catalog with.
4. Tap Share, and enjoy productive teamwork!
🔎 TIP: In Aginity Premium, you can also use drag and drop to move any Catalog entry in another already shared folder.