Automatic querying through selection of registered data sets
Methods and systems described herein are directed to creating customized queries on data sets via selection of search elements based on meta-data from data set registrations. In some implementations, an automatic query system can register database elements with associated meta-data by receiving programming data objects, corresponding to database elements, with meta-data and adding the programming objects as selectable values for a user interface (UI). Each data object can define one or more elements for a table and/or column(s) within a table in a database. The automatic query system can provide the UI to a user to receive table and column selections. The automatic query system can select a root table to join the selected tables into, and generate a join query for the root table by inserting search string snippets, corresponding to selected tables and columns, into a query template.
1 . A method comprising:
receiving, from a user interface, selections of two or more tables and one or more columns for a join query, wherein the user interface is based on programming data objects corresponding to one or more database elements;
selecting a first table of the two or more tables as a root table for the join query based on the first table having a highest number of connections between each of the two or more tables;
resolving code snippets, from the programming data objects corresponding to the two or more tables and the one or more columns, into search string snippets;
executing the join query to:
insert, into a root table slot in a query template, a search string snippet for the root table;
insert, into a join table slot in the query template, one or more search string snippets for one or more tables of the two or more tables that are not the root table; and
insert into a column select slot in the query template, the one or more search string snippets for the one or more columns; and
displaying one or more results of the execution of the join query.
2 . The method of claim 1 , further comprising:
adding the programming data objects as selectable elements for the user interface,
wherein tables are added as selectable elements, and
wherein the user interface is configured to show columns, as selectable elements, from corresponding selected tables.
3 . The method of claim 1 , further comprising:
receiving, from the user interface, one or more value filter selections for the join query; and
generating the one or more value filter selections into search string snippets.
4 . The method of claim 1 , wherein generating the join query further comprises:
inserting, into a value filter selection slot in the query template, search string snippets for one or more value filter selections.
5 . The method of claim 1 , further comprising:
determining column labels that the two or more tables have in common; and
selecting the first table of the two or more tables as the root table based on the first table having a highest number of column labels in common between each of the two or more tables.
6 . The method of claim 1 , further comprising:
filtering a list of selectable tables to present tables that can be joined with previously selected tables.
7 . The method of claim 1 , further comprising:
removing one or more tables from a list of selectable tables when the one or more tables have no connections with previously selected tables.
8 . A system comprising:
one or more processors; and
one or more memories storing instructions that, when executed by the one or more processors, cause the system to perform a process comprising:
receiving, from a user interface, selections of two or more tables and one or more columns for a join query, wherein the user interface is based on programming data objects corresponding to one or more database elements;
selecting a first table of the two or more tables as a root table for the join query based on the first table having a highest number of connections between each of the two or more tables;
resolving code snippets, from the programming data objects corresponding to the two or more tables and the one or more columns, into search string snippets;
executing the join query to:
insert, into a root table slot in a query template, a search string snippet for the root table;
insert, into a join table slot in the query template, one or more search string snippets for one or more tables of the two or more tables that are not the root table; and
insert into a column select slot in the query template, the one or more search string snippets for the one or more columns; and
displaying one or more results of the execution of the join query.
9 . The system according to claim 8 , wherein the process further comprises:
adding the programming data objects as selectable elements for the user interface,
wherein tables are added as selectable elements, and
wherein the user interface is configured to show columns, as selectable elements, from corresponding selected tables.
10 . The system according to claim 8 , wherein the process further comprises:
receiving, from the user interface, one or more value filter selections for the join query; and
generating the one or more value filter selections into search string snippets.
11 . The system according to claim 8 , wherein generating the join query further comprises:
inserting, into a value filter selection slot in the query template, search string snippets for one or more value filter selections.
12 . The system according to claim 8 , wherein the process further comprises:
determining column labels that the two or more tables have in common; and
selecting the first table of the two or more tables as the root table based on the first table having a highest number of column labels in common between each of the two or more tables.
13 . The system according to claim 8 , wherein the process further comprises:
filtering a list of selectable tables to present tables that can be joined with previously selected tables.
14 . The system according to claim 8 , wherein the process further comprises:
removing one or more tables from a list of selectable tables when the one or more tables have no connections with previously selected tables.
15 . A non-transitory computer-readable medium storing instructions that, when executed by a computing system, cause the computing system to perform operations comprising:
receiving, from a user interface, selections of two or more tables and one or more columns for a join query, wherein the user interface is based on programming data objects corresponding to one or more database elements;
selecting a first table of the two or more tables as a root table for the join query based on the first table having a highest number of connections between each of the two or more tables;
resolving code snippets, from the programming data objects corresponding to the two or more tables and the one or more columns, into search string snippets;
executing the join query to:
insert, into a root table slot in a query template, a search string snippet for the root table;
insert, into a join table slot in the query template, one or more search string snippets for one or more tables of the two or more tables that are not the root table; and
insert into a column select slot in the query template, the one or more search string snippets for the one or more columns; and
displaying one or more results of the execution of the join query.
16 . The non-transitory computer-readable medium of claim 15 , wherein the operations further comprise:
adding the programming data objects as selectable elements for the user interface,
wherein tables are added as selectable elements, and
wherein the user interface is configured to show columns, as selectable elements, from corresponding selected tables.
17 . The non-transitory computer-readable medium of claim 15 , wherein the operations further comprise:
receiving, from the user interface, one or more value filter selections for the join query; and
generating the one or more value filter selections into search string snippets.
18 . The non-transitory computer-readable medium of claim 15 , wherein generating the join query further comprises:
inserting, into a value filter selection slot in the query template, search string snippets for one or more value filter selections.
19 . The non-transitory computer-readable medium of claim 15 , wherein the operations further comprise:
determining column labels that the two or more tables have in common; and
selecting the first table of the two or more tables as the root table based on the first table having a highest number of column labels in common between each of the two or more tables.
20 . The non-transitory computer-readable medium of claim 15 , wherein the operations further comprise:
filtering a list of selectable tables to present tables that can be joined with previously selected tables.