1
0
Fork 0
mirror of synced 2024-09-20 11:27:56 +12:00

Add Oracle to datasource.spec.ts.

This commit is contained in:
Sam Rose 2024-08-06 09:58:02 +01:00
parent f846507877
commit a451b6eb3c
No known key found for this signature in database
2 changed files with 5 additions and 9 deletions

View file

@ -164,6 +164,7 @@ describe("/datasources", () => {
[DatabaseName.MYSQL, getDatasource(DatabaseName.MYSQL)],
[DatabaseName.SQL_SERVER, getDatasource(DatabaseName.SQL_SERVER)],
[DatabaseName.MARIADB, getDatasource(DatabaseName.MARIADB)],
[DatabaseName.ORACLE, getDatasource(DatabaseName.ORACLE)],
])("%s", (_, dsProvider) => {
let rawDatasource: Datasource
beforeEach(async () => {
@ -285,9 +286,6 @@ describe("/datasources", () => {
[FieldType.STRING]: {
name: stringName,
type: FieldType.STRING,
constraints: {
presence: true,
},
},
[FieldType.LONGFORM]: {
name: "longform",
@ -381,10 +379,6 @@ describe("/datasources", () => {
),
schema: Object.entries(table.schema).reduce<TableSchema>(
(acc, [fieldName, field]) => {
// the constraint will be unset - as the DB doesn't recognise it as not null
if (fieldName === stringName) {
field.constraints = {}
}
acc[fieldName] = expect.objectContaining({
...field,
})
@ -441,7 +435,7 @@ describe("/datasources", () => {
})
describe("info", () => {
it("should fetch information about postgres datasource", async () => {
it("should fetch information about a datasource", async () => {
const table = await config.api.table.save(
tableForDatasource(datasource, {
schema: {

View file

@ -400,7 +400,9 @@ class OracleIntegration extends Sql implements DatasourcePlus {
if (oracleConstraint.type === OracleContraintTypes.PRIMARY) {
table.primary!.push(columnName)
} else if (
oracleConstraint.type === OracleContraintTypes.NOT_NULL_OR_CHECK
oracleConstraint.type ===
OracleContraintTypes.NOT_NULL_OR_CHECK &&
oracleConstraint.searchCondition?.endsWith("IS NOT NULL")
) {
table.schema[columnName].constraints = {
presence: true,