Browse Source

Merge branch 'develop' into fix/import-csv-date

pull/4611/head
Wing-Kam Wong 2 years ago
parent
commit
09f26b75bd
  1. 16
      .github/uffizzi/docker-compose.uffizzi.yml
  2. 2
      packages/nocodb/src/lib/db/sql-client/lib/sqlite/SqliteClient.ts
  3. 5
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts
  4. 1
      packages/nocodb/src/lib/meta/MetaAPILogger.ts
  5. 4
      packages/nocodb/src/lib/meta/NcMetaIOImpl.ts
  6. 1
      packages/nocodb/src/lib/meta/api/projectApis.ts
  7. 2
      packages/nocodb/src/lib/utils/NcConfigFactory.ts

16
.github/uffizzi/docker-compose.uffizzi.yml

@ -6,13 +6,27 @@ x-uffizzi:
port: 8080
services:
root_db:
postgres:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
POSTGRES_DB: root_db
mssql:
image: "mcr.microsoft.com/mssql/server:2017-latest"
restart: always
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: Password123.
mysql:
environment:
MYSQL_DATABASE: root_db
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: noco
image: "mysql:5.7"
restart: always
nocodb:
image: "${NOCODB_IMAGE}"
ports:

2
packages/nocodb/src/lib/db/sql-client/lib/sqlite/SqliteClient.ts

@ -19,6 +19,8 @@ class SqliteClient extends KnexClient {
private _version: any;
constructor(connectionConfig) {
// sqlite does not support inserting default values and knex fires a warning without this flag
connectionConfig.connection.useNullAsDefault = true;
super(connectionConfig);
this.sqlClient = knex(connectionConfig.connection);
this.queries = queries;

5
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/CustomKnex.ts

@ -988,6 +988,11 @@ function parseNestedCondition(obj, qb, pKey?, table?, tableAlias?) {
type CustomKnex = Knex;
function CustomKnex(arg: string | Knex.Config<any> | any): CustomKnex {
// sqlite does not support inserting default values and knex fires a warning without this flag
if (arg?.client === 'sqlite3') {
arg.useNullAsDefault = true;
}
const kn: any = knex(arg);
const knexRaw = kn.raw;

1
packages/nocodb/src/lib/meta/MetaAPILogger.ts

@ -11,7 +11,6 @@ export default class MetaAPILogger {
connection: {
filename: 'noco_log.db',
},
useNullAsDefault: true,
});
}

4
packages/nocodb/src/lib/meta/NcMetaIOImpl.ts

@ -77,10 +77,6 @@ export default class NcMetaIOImpl extends NcMetaIO {
constructor(app: Noco, config: NcConfig, trx = null) {
super(app, config);
if (this.config?.meta?.db?.client === 'sqlite3') {
this.config.meta.db.useNullAsDefault = true;
}
if (this.config?.meta?.db) {
this.connection = trx || XKnex(this.config?.meta?.db);
} else {

1
packages/nocodb/src/lib/meta/api/projectApis.ts

@ -138,7 +138,6 @@ async function projectCreate(req: Request<any, any>, res) {
connection: {
filename: `${toolDir}/nc_minimal_dbs/${projectTitle}_${dbId}.db`,
},
useNullAsDefault: true,
},
},
inflection_column: 'camelize',

2
packages/nocodb/src/lib/utils/NcConfigFactory.ts

@ -200,7 +200,6 @@ export default class NcConfigFactory implements NcConfig {
},
database:
url.searchParams.get('d') || url.searchParams.get('database'),
useNullAsDefault: true,
},
} as any;
} else {
@ -496,7 +495,6 @@ export default class NcConfigFactory implements NcConfig {
connection: {
...dbConnectionConfig,
database: dbConnectionConfig.connection.filename,
useNullAsDefault: true,
},
};
}

Loading…
Cancel
Save