mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-11 07:11:02 +00:00
added updated_at column to show tables output (#2364)
(cherry picked from commit 9759602f94)
This commit is contained in:
parent
75999414a7
commit
b46a82ea33
3 changed files with 18 additions and 4 deletions
|
|
@ -53,14 +53,20 @@ func (p *ExecutionPlanner) compileShowTablesStatement(stmt parser.Statement) (ty
|
|||
},
|
||||
&qualifiedRefPlanExpression{
|
||||
tableName: "fb_tables",
|
||||
columnName: "keys",
|
||||
columnName: "updated_at",
|
||||
columnIndex: 5,
|
||||
dataType: parser.NewDataTypeTimestamp(),
|
||||
},
|
||||
&qualifiedRefPlanExpression{
|
||||
tableName: "fb_tables",
|
||||
columnName: "keys",
|
||||
columnIndex: 6,
|
||||
dataType: parser.NewDataTypeBool(),
|
||||
},
|
||||
&qualifiedRefPlanExpression{
|
||||
tableName: "fb_tables",
|
||||
columnName: "description",
|
||||
columnIndex: 6,
|
||||
columnIndex: 7,
|
||||
dataType: parser.NewDataTypeString(),
|
||||
}}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,6 +76,11 @@ func (p *PlanOpFeatureBaseTables) Schema() types.Schema {
|
|||
ColumnName: "created_at",
|
||||
Type: parser.NewDataTypeTimestamp(),
|
||||
},
|
||||
&types.PlannerColumn{
|
||||
RelationName: "fb_tables",
|
||||
ColumnName: "updated_at",
|
||||
Type: parser.NewDataTypeTimestamp(),
|
||||
},
|
||||
&types.PlannerColumn{
|
||||
RelationName: "fb_tables",
|
||||
ColumnName: "keys",
|
||||
|
|
@ -112,13 +117,15 @@ var _ types.RowIterator = (*showTablesRowIter)(nil)
|
|||
|
||||
func (i *showTablesRowIter) Next(ctx context.Context) (types.Row, error) {
|
||||
if i.rowIndex < len(i.indexInfo) {
|
||||
tm := time.Unix(0, i.indexInfo[i.rowIndex].CreatedAt)
|
||||
createdAt := time.Unix(0, i.indexInfo[i.rowIndex].CreatedAt)
|
||||
updatedAt := time.Unix(0, i.indexInfo[i.rowIndex].UpdatedAt)
|
||||
row := []interface{}{
|
||||
i.indexInfo[i.rowIndex].Name,
|
||||
i.indexInfo[i.rowIndex].Name,
|
||||
i.indexInfo[i.rowIndex].Owner,
|
||||
i.indexInfo[i.rowIndex].LastUpdateUser,
|
||||
tm.Format(time.RFC3339),
|
||||
createdAt.Format(time.RFC3339),
|
||||
updatedAt.Format(time.RFC3339),
|
||||
i.indexInfo[i.rowIndex].Options.Keys,
|
||||
i.indexInfo[i.rowIndex].Options.Description,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ func TestPlanner_Show(t *testing.T) {
|
|||
wireQueryFieldString("owner"),
|
||||
wireQueryFieldString("updated_by"),
|
||||
wireQueryFieldTimestamp("created_at"),
|
||||
wireQueryFieldTimestamp("updated_at"),
|
||||
wireQueryFieldBool("keys"),
|
||||
wireQueryFieldString("description"),
|
||||
}, columns); diff != "" {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue