Merge branch 'feature/opinionated-sql' of github.com:Budibase/budibase into feature/opinionated-sql
This commit is contained in:
commit
ceed5e0c07
|
@ -2,7 +2,7 @@
|
|||
export let value
|
||||
</script>
|
||||
|
||||
<div>{value}</div>
|
||||
<div>{typeof value === "object" ? JSON.stringify(value) : value}</div>
|
||||
|
||||
<style>
|
||||
div {
|
||||
|
|
|
@ -14,6 +14,7 @@ const TYPE_MAP = {
|
|||
timestamp: FieldTypes.DATETIME,
|
||||
time: FieldTypes.DATETIME,
|
||||
boolean: FieldTypes.BOOLEAN,
|
||||
json: FIELD_TYPES.JSON,
|
||||
}
|
||||
|
||||
const SCHEMA = {
|
||||
|
@ -87,7 +88,7 @@ class PostgresPlus extends Sql {
|
|||
try {
|
||||
const primaryKeysResponse = await this.client.query(this.PRIMARY_KEYS_SQL)
|
||||
for (let table of primaryKeysResponse.rows) {
|
||||
keys.push(table.column_name)
|
||||
keys.push(table.column_name || table.primary_key)
|
||||
}
|
||||
} catch (err) {
|
||||
// TODO: this try catch method isn't right
|
||||
|
@ -114,7 +115,7 @@ class PostgresPlus extends Sql {
|
|||
|
||||
tables[tableName].schema[columnName] = {
|
||||
name: columnName,
|
||||
type: TYPE_MAP[column.data_type],
|
||||
type: TYPE_MAP[column.data_type] || FIELD_TYPES.STRING,
|
||||
}
|
||||
}
|
||||
this.tables = tables
|
||||
|
|
Loading…
Reference in New Issue