# Functions
AllUserEmployees is created from:
<stmt name="AllUserEmployees">
SELECT
<wc table="user"/>,
CAST(DATEDIFF(NOW(), birthday)/365 AS UNSIGNED) AS age,
<wc table="employee" as="empl"/>
FROM
user LEFT JOIN employee AS empl ON user.id=empl.user_id
</stmt>
*/.
EmployeeByEmployeeSn is used to select Employee by `employee_sn` index.
EmployeeByPrimary is used to select Employee by `PRIMARY` index.
EmployeeByUserId is used to select Employee by `user_id` index.
NewTableMeta creates a new TableMeta.
OptAutoIncColumn sets the auto increment column.
OptColumnsWithDefault sets the columns that have not NULL server side default, including: - AUTO_INCREMENT - NOW() - Other not NULL constant defaults.
OptPrimaryColumns sets the primary key columns.
SubordinatesBySuperiors is created from:
<stmt name="SubordinatesBySuperiors">
<a name="id" type="...int"/>
<v in_query="1"/>
SELECT
<wc table="employee" as="superior"/>,
<wc table="employee" as="subordinate"/>
FROM
employee AS superior LEFT JOIN employee AS subordinate ON subordinate.superior_id=superior.id
WHERE
superior.id IN (<b name="id"/>)
</stmt>
*/.
UserByPrimary is used to select User by `PRIMARY` index.
UsersByCond is created from:
<stmt name="UsersByCond">
<v use_template="1"/>
<a name="id" type="int"/>
<a name="name" type="string"/>
<a name="birthday" type="time.Time"/>
<a name="limit" type="int"/>
SELECT
<wc table="user"/>
FROM
user
WHERE
<t>{{ if ne .id 0 }}</t>
id=<b name="id"/> AND
<t>{{ end }}</t>
<t>{{ if ne (len .name) 0 }}</t>
name=<b name="name"/> AND
<t>{{ end }}</t>
<t>{{ if not .birthday.IsZero }}</t>
birthday=<b name="birthday"/> AND
<t>{{ end }}</t>
1
LIMIT <b name="limit">10</b>
</stmt>
*/.
# Structs
AllUserEmployeesResult is the result of `AllUserEmployees`.
Employee represents a row of table `employee`.
SubordinatesBySuperiorsResult is the result of `SubordinatesBySuperiors`.
TableMeta contains meta information of a database table.
User represents a row of table `user`.
# Interfaces
ColumnScanner represents a collection of columns that can be scanned into from a row.
Execer is the common interface to execute a query without returning any row.
ExecQueryer = Execer + Queryer.
Queryer is the common interface to execute a query returning row(s).
Slicer represents an appendable slice.
TableRow represents a table's row.
TableRowWithPrimary represents row of table with primary key.
# Type aliases
AllUserEmployeesResultSlice is slice of AllUserEmployeesResult.
EmployeeSlice is slice of Employee.
SubordinatesBySuperiorsResultSlice is slice of SubordinatesBySuperiorsResult.
TableMetaOption is used in creating TableMeta.
UserSlice is slice of User.