Browse Source

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

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

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

@ -6,13 +6,27 @@ x-uffizzi:
port: 8080 port: 8080
services: services:
root_db: postgres:
image: postgres image: postgres
restart: always restart: always
environment: environment:
POSTGRES_PASSWORD: password POSTGRES_PASSWORD: password
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_DB: root_db 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: nocodb:
image: "${NOCODB_IMAGE}" image: "${NOCODB_IMAGE}"
ports: ports:
@ -21,4 +35,4 @@ services:
environment: environment:
NC_DB: "pg://localhost:5432?u=postgres&p=password&d=root_db" NC_DB: "pg://localhost:5432?u=postgres&p=password&d=root_db"
NC_ADMIN_EMAIL: admin@nocodb.com NC_ADMIN_EMAIL: admin@nocodb.com
NC_ADMIN_PASSWORD: password NC_ADMIN_PASSWORD: password

2
packages/nocodb-sdk/.cspell.json

@ -31,4 +31,4 @@
"tsconfig.json", "tsconfig.json",
"node_modules/**" "node_modules/**"
] ]
} }

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

@ -19,6 +19,8 @@ class SqliteClient extends KnexClient {
private _version: any; private _version: any;
constructor(connectionConfig) { constructor(connectionConfig) {
// sqlite does not support inserting default values and knex fires a warning without this flag
connectionConfig.connection.useNullAsDefault = true;
super(connectionConfig); super(connectionConfig);
this.sqlClient = knex(connectionConfig.connection); this.sqlClient = knex(connectionConfig.connection);
this.queries = queries; 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; type CustomKnex = Knex;
function CustomKnex(arg: string | Knex.Config<any> | any): CustomKnex { 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 kn: any = knex(arg);
const knexRaw = kn.raw; const knexRaw = kn.raw;

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

@ -11,7 +11,6 @@ export default class MetaAPILogger {
connection: { connection: {
filename: 'noco_log.db', 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) { constructor(app: Noco, config: NcConfig, trx = null) {
super(app, config); super(app, config);
if (this.config?.meta?.db?.client === 'sqlite3') {
this.config.meta.db.useNullAsDefault = true;
}
if (this.config?.meta?.db) { if (this.config?.meta?.db) {
this.connection = trx || XKnex(this.config?.meta?.db); this.connection = trx || XKnex(this.config?.meta?.db);
} else { } else {

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

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

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

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

Loading…
Cancel
Save