1.. currentmodule:: Orange.data.sql.table 2 3######################## 4SQL table (``data.sql``) 5######################## 6 7.. autoclass:: Orange.data.sql.table.SqlTable 8 :members: 9 :special-members: 10 11 :obj:`SqlTable` represents a table with the data which is stored in the 12 database. Besides the inherited attributes, the object stores a connection 13 to the database and row filters. 14 15 Constructor connects to the database, infers the variable types from the 16 types of the columns in the database and constructs the corresponding 17 domain description. Discrete and continuous variables are put among 18 attributes, and string variables are meta attributes. The domain does not 19 have a class. 20 21 :obj:`SqlTable` overloads the data access methods for random access to 22 rows and for iteration (`__getitem__` and `__iter__`). It also provides 23 methods for fast computation of basic statistics, distributions and 24 contingency matrices, as well as for filtering the data. Filtering the 25 data returns a new instance of :obj:`SqlTable`. The new instances however 26 differs only in that an additional filter is added to the row_filter. 27 28 All evaluation is lazy in the sense that most operations just modify the 29 domain and the list of filters. These are used to construct an SQL query 30 when the data is actually needed, for instance to retrieve a data row or 31 compute a distribution of values for a certain column. 32 33 .. attribute:: connection 34 35 The object that holds the database connection. An instance of a class 36 compatible with Python DB API 2.0. 37 38 .. attribute:: host 39 40 The host name of the database server 41 42 .. attribute:: database 43 44 The name of the database 45 46 .. attribute:: table_name 47 48 The name of the table in the database 49 50 .. attribute:: row_filters 51 52 A list of filters that are applied when constructing the query. The 53 filters in the should have a method `to_sql`. Module 54 :obj:`Orange.data.sql.filter` contains classes derived from filters in 55 :obj:`Orange.data.filter` with the appropriate implementation of the 56 method. 57 58 59.. autoclass:: Orange.data.sql.table.SqlRowInstance 60 :members: 61