Tidy up the Table SQL interface a bit
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				CI / release-test (push) Successful in 2m33s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	CI / release-test (push) Successful in 2m33s
				
			This commit is contained in:
		
							parent
							
								
									754c21ab29
								
							
						
					
					
						commit
						14d395f0ea
					
				| @ -27,7 +27,7 @@ func SchemaFromDB(db *sqlx.DB) Schema { | |||||||
| 	ret := Schema{} | 	ret := Schema{} | ||||||
| 
 | 
 | ||||||
| 	var tables []Table | 	var tables []Table | ||||||
| 	err := db.Select(&tables, `select name, strict from tables`) | 	err := db.Select(&tables, `select name, is_strict, is_without_rowid from tables`) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		panic(err) | 		panic(err) | ||||||
| 	} | 	} | ||||||
|  | |||||||
| @ -22,7 +22,9 @@ func (c Column) IsNullableForeignKey() bool { | |||||||
| // Table is a single SQLite table. | // Table is a single SQLite table. | ||||||
| type Table struct { | type Table struct { | ||||||
| 	TableName      string `db:"name"` | 	TableName      string `db:"name"` | ||||||
| 	IsStrict  bool   `db:"strict"` | 	IsStrict       bool   `db:"is_strict"` | ||||||
|  | 	IsWithoutRowid bool   `db:"is_without_rowid"` | ||||||
|  | 
 | ||||||
| 	Columns []Column | 	Columns []Column | ||||||
| 
 | 
 | ||||||
| 	TypeIDName string | 	TypeIDName string | ||||||
|  | |||||||
| @ -1,5 +1,9 @@ | |||||||
| create temporary view tables as | create temporary view tables as | ||||||
|     select l.schema, l.name, l.type, l.ncol, l.wr, l.strict |     select l.schema, | ||||||
|  |            l.name, | ||||||
|  |            l.type, | ||||||
|  |            l.wr as is_without_rowid, | ||||||
|  |            l.strict as is_strict | ||||||
|       from sqlite_schema s |       from sqlite_schema s | ||||||
|  left join pragma_table_list l on s.name = l.name |  left join pragma_table_list l on s.name = l.name | ||||||
|      where s.type = 'table'; |      where s.type = 'table'; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user