diff --git a/cli/README.md b/cli/README.md index 1017807f2..d96568461 100644 --- a/cli/README.md +++ b/cli/README.md @@ -162,6 +162,8 @@ Issues: View it on [npm](https://www.npmjs.com/package/azimutt). +If any issue, unpublish the package with: `npm unpublish azimutt@0.1.33` + ## Dev If you need to develop on multiple libs at the same time (ex: want to update a connector and try it through the CLI), depend on local libs but publish & revert before commit. diff --git a/cli/package.json b/cli/package.json index e0236667c..3fa4e630a 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "azimutt", - "version": "0.1.32", + "version": "0.1.34", "description": "Export database schema from relational or document databases. Import it to https://azimutt.app", "keywords": [ "database", diff --git a/gateway/package-lock.json b/gateway/package-lock.json index d6967d71e..80068f249 100644 --- a/gateway/package-lock.json +++ b/gateway/package-lock.json @@ -1,25 +1,25 @@ { "name": "@azimutt/gateway", - "version": "0.1.19", + "version": "0.1.21", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@azimutt/gateway", - "version": "0.1.19", + "version": "0.1.21", "license": "MIT", "dependencies": { "@azimutt/connector-bigquery": "^0.1.2", "@azimutt/connector-couchbase": "^0.1.2", - "@azimutt/connector-mariadb": "^0.1.6", + "@azimutt/connector-mariadb": "^0.1.7", "@azimutt/connector-mongodb": "^0.1.4", "@azimutt/connector-mysql": "^0.1.5", "@azimutt/connector-oracle": "^0.1.3", "@azimutt/connector-postgres": "^0.1.11", "@azimutt/connector-snowflake": "^0.1.2", "@azimutt/connector-sqlserver": "^0.1.4", - "@azimutt/models": "^0.1.15", - "@azimutt/utils": "^0.1.6", + "@azimutt/models": "^0.1.16", + "@azimutt/utils": "^0.1.7", "@fastify/cors": "9.0.1", "@sinclair/typebox": "0.29.6", "ajv": "8.17.1", @@ -44,10 +44,6 @@ "tsx": "^4.19.2", "typescript": "^5.6.3", "vitest": "^2.1.4" - }, - "engines": { - "node": "21.6.0", - "npm": "10.3.0" } }, "node_modules/@aws-crypto/crc32": { @@ -1036,12 +1032,13 @@ } }, "node_modules/@azimutt/connector-mariadb": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@azimutt/connector-mariadb/-/connector-mariadb-0.1.6.tgz", - "integrity": "sha512-WLWxHTRYS2PZxhzN8vTh4sIvXBeT2mw7x6xE9rWoxU9VGEwuTLl+STxtVUxb2sxFCtItyiKZ5QPXILDt5pKk0w==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@azimutt/connector-mariadb/-/connector-mariadb-0.1.7.tgz", + "integrity": "sha512-fGKgn2FKxjj0/aVqilkFmNY58PmYGMYYG/Qn2xwGldL9WmfX1mxkEvqljNvJv4Q2ikfI33ODCjQ7XgKqUyH4Ug==", + "license": "MIT", "dependencies": { - "@azimutt/models": "^0.1.15", - "@azimutt/utils": "^0.1.6", + "@azimutt/models": "^0.1.16", + "@azimutt/utils": "^0.1.7", "mariadb": "3.3.1" } }, @@ -1107,9 +1104,10 @@ } }, "node_modules/@azimutt/models": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/@azimutt/models/-/models-0.1.15.tgz", - "integrity": "sha512-Cog6HffVeKKPqx4KJE2iSYYy3ypE678cl2fIDDaeMsNHU8Agx6fXaOOOm9mj8MY1E7QANTIse2qFls9OXaB5Tg==", + "version": "0.1.16", + "resolved": "https://registry.npmjs.org/@azimutt/models/-/models-0.1.16.tgz", + "integrity": "sha512-cW/ATuEb97Slivnehbq3UyjgTilYpsJpLJ5qkWgBZOI6ldbBld9179ywopz17XvhjVBiZu1NGEm/jDPBXV8xOw==", + "license": "MIT", "dependencies": { "@azimutt/utils": "^0.1.6", "openai": "4.65.0", @@ -1118,9 +1116,10 @@ } }, "node_modules/@azimutt/utils": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@azimutt/utils/-/utils-0.1.6.tgz", - "integrity": "sha512-Qbe+78I1oseQUBJ82HbRK3OZKTiltStd+6bvnrvrnjWYMq739y86PDk4Jo5Ua8lT/i4jv9Gb5Ye584PuIXhXbw==" + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@azimutt/utils/-/utils-0.1.7.tgz", + "integrity": "sha512-AS0/5dK+YVk0cmQDe+ONgODpeHzCQEjaDIe5fp/EoKMTOBU9niaB2HpAxyeu6zZg0svHCFkAc3sfGc3k+pPcjQ==", + "license": "MIT" }, "node_modules/@azure/abort-controller": { "version": "1.1.0", diff --git a/gateway/package.json b/gateway/package.json index f2d7f3a87..a6cfc3170 100644 --- a/gateway/package.json +++ b/gateway/package.json @@ -1,6 +1,6 @@ { "name": "@azimutt/gateway", - "version": "0.1.19", + "version": "0.1.21", "description": "A Gateway to proxy database access for Azimutt frontend", "keywords": [ "database", @@ -42,15 +42,15 @@ "dependencies": { "@azimutt/connector-bigquery": "^0.1.2", "@azimutt/connector-couchbase": "^0.1.2", - "@azimutt/connector-mariadb": "^0.1.6", + "@azimutt/connector-mariadb": "^0.1.7", "@azimutt/connector-mongodb": "^0.1.4", "@azimutt/connector-mysql": "^0.1.5", "@azimutt/connector-oracle": "^0.1.3", "@azimutt/connector-postgres": "^0.1.11", "@azimutt/connector-snowflake": "^0.1.2", "@azimutt/connector-sqlserver": "^0.1.4", - "@azimutt/models": "^0.1.15", - "@azimutt/utils": "^0.1.6", + "@azimutt/models": "^0.1.16", + "@azimutt/utils": "^0.1.7", "@fastify/cors": "9.0.1", "@sinclair/typebox": "0.29.6", "ajv": "8.17.1", @@ -75,9 +75,5 @@ "tsx": "^4.19.2", "typescript": "^5.6.3", "vitest": "^2.1.4" - }, - "engines": { - "node": "21.6.0", - "npm": "10.3.0" } } diff --git a/libs/connector-mariadb/package.json b/libs/connector-mariadb/package.json index 7701bce4d..114fe0abe 100644 --- a/libs/connector-mariadb/package.json +++ b/libs/connector-mariadb/package.json @@ -1,6 +1,6 @@ { "name": "@azimutt/connector-mariadb", - "version": "0.1.6", + "version": "0.1.7", "description": "Connect to MariaDB, extract schema, run analysis and queries", "keywords": [], "homepage": "https://azimutt.app", diff --git a/libs/connector-mariadb/src/mariadb.ts b/libs/connector-mariadb/src/mariadb.ts index e621acd83..267428c4a 100644 --- a/libs/connector-mariadb/src/mariadb.ts +++ b/libs/connector-mariadb/src/mariadb.ts @@ -149,7 +149,7 @@ function buildEntity(table: RawTable, columns: RawColumn[], primaryKeyColumns: R kind: table.table_kind === 'VIEW' || table.table_kind === 'SYSTEM VIEW' ? 'view' as const : undefined, def: table.definition || undefined, attrs: columns.slice(0) - .sort((a, b) => (a.column_index || 0) - (b.column_index || 0)) + .sort((a, b) => a.column_index > b.column_index ? 1 : a.column_index < b.column_index ? -1 : 0) .map(c => buildAttribute(c, jsonColumns[c.column_name], polyColumns[c.column_name])), pk: primaryKeyColumns.length > 0 ? buildPrimaryKey(primaryKeyColumns) : undefined, indexes: indexes.map(buildIndex), @@ -175,7 +175,7 @@ function buildEntity(table: RawTable, columns: RawColumn[], primaryKeyColumns: R export type RawColumn = { table_schema: string table_name: string - column_index: number + column_index: number | bigint column_name: string column_type: string column_nullable: 'YES' | 'NO' @@ -232,7 +232,7 @@ export type RawConstraintColumn = { table_schema: string table_name: string column_name: string - column_index: number + column_index: number | bigint ref_schema: string | null ref_table: string | null ref_column: string | null @@ -278,7 +278,7 @@ function buildPrimaryKey(columns: RawConstraintColumn[]): PrimaryKey { return removeUndefined({ name: first.constraint_name === 'PRIMARY' ? undefined : first.constraint_name || undefined, attrs: columns.slice(0) - .sort((a, b) => (a.column_index || 0) - (b.column_index || 0)) + .sort((a, b) => a.column_index > b.column_index ? 1 : a.column_index < b.column_index ? -1 : 0) .map(c => [c.column_name]), doc: undefined, stats: undefined, @@ -291,7 +291,7 @@ function buildIndex(columns: RawConstraintColumn[]): Index { return removeUndefined({ name: first.constraint_name || undefined, attrs: columns.slice(0) - .sort((a, b) => (a.column_index || 0) - (b.column_index || 0)) + .sort((a, b) => a.column_index > b.column_index ? 1 : a.column_index < b.column_index ? -1 : 0) .map(c => [c.column_name]), unique: first.constraint_type === 'UNIQUE' ? true : undefined, // false when not specified partial: undefined, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6196ba05c..039ade2ec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -424,8 +424,8 @@ importers: specifier: ^0.1.2 version: 0.1.2 '@azimutt/connector-mariadb': - specifier: ^0.1.6 - version: 0.1.6 + specifier: ^0.1.7 + version: 0.1.7 '@azimutt/connector-mongodb': specifier: ^0.1.4 version: 0.1.4(socks@2.8.3) @@ -445,11 +445,11 @@ importers: specifier: ^0.1.4 version: 0.1.4 '@azimutt/models': - specifier: ^0.1.15 - version: 0.1.15 + specifier: ^0.1.16 + version: 0.1.16 '@azimutt/utils': - specifier: ^0.1.6 - version: 0.1.6 + specifier: ^0.1.7 + version: 0.1.7 '@fastify/cors': specifier: 9.0.1 version: 9.0.1 @@ -1293,8 +1293,8 @@ packages: '@azimutt/connector-couchbase@0.1.2': resolution: {integrity: sha512-14c77x/V0ZYeXinzvfpcZ9Q/Z/O4BzWjr477SdmuXkM00OGkenOYuIcj0ri5TvNpdS/9P8fVoASCfXsA4AxHgg==} - '@azimutt/connector-mariadb@0.1.6': - resolution: {integrity: sha512-WLWxHTRYS2PZxhzN8vTh4sIvXBeT2mw7x6xE9rWoxU9VGEwuTLl+STxtVUxb2sxFCtItyiKZ5QPXILDt5pKk0w==} + '@azimutt/connector-mariadb@0.1.7': + resolution: {integrity: sha512-fGKgn2FKxjj0/aVqilkFmNY58PmYGMYYG/Qn2xwGldL9WmfX1mxkEvqljNvJv4Q2ikfI33ODCjQ7XgKqUyH4Ug==} '@azimutt/connector-mongodb@0.1.4': resolution: {integrity: sha512-cExHFYICE1/riBcuhINSe9BmX45+gLgYWvsY4G/tPu3SjtN8e0nqxx5B7Z5EzmnIXT5TvSbox6KWdtghWWsWiQ==} @@ -1314,11 +1314,11 @@ packages: '@azimutt/connector-sqlserver@0.1.4': resolution: {integrity: sha512-I5U33eYIgm22RXGtSWhF9rA2NTv18cym28X0/DopmQqD9A1ZCDRnlES8FDJRee5ngASgsgYm4glp0aQXhd32/Q==} - '@azimutt/models@0.1.15': - resolution: {integrity: sha512-Cog6HffVeKKPqx4KJE2iSYYy3ypE678cl2fIDDaeMsNHU8Agx6fXaOOOm9mj8MY1E7QANTIse2qFls9OXaB5Tg==} + '@azimutt/models@0.1.16': + resolution: {integrity: sha512-cW/ATuEb97Slivnehbq3UyjgTilYpsJpLJ5qkWgBZOI6ldbBld9179ywopz17XvhjVBiZu1NGEm/jDPBXV8xOw==} - '@azimutt/utils@0.1.6': - resolution: {integrity: sha512-Qbe+78I1oseQUBJ82HbRK3OZKTiltStd+6bvnrvrnjWYMq739y86PDk4Jo5Ua8lT/i4jv9Gb5Ye584PuIXhXbw==} + '@azimutt/utils@0.1.7': + resolution: {integrity: sha512-AS0/5dK+YVk0cmQDe+ONgODpeHzCQEjaDIe5fp/EoKMTOBU9niaB2HpAxyeu6zZg0svHCFkAc3sfGc3k+pPcjQ==} '@azure/abort-controller@2.1.2': resolution: {integrity: sha512-nBrLsEWm4J2u5LpAPjxADTlq3trDgVZZXHNKabeXZtpq3d3AbN/KGO82R87rdDz5/lYB024rtEf10/q0urNgsA==} @@ -9839,8 +9839,8 @@ snapshots: '@azimutt/connector-bigquery@0.1.2': dependencies: - '@azimutt/models': 0.1.15 - '@azimutt/utils': 0.1.6 + '@azimutt/models': 0.1.16 + '@azimutt/utils': 0.1.7 '@google-cloud/bigquery': 7.7.0(encoding@0.1.13) transitivePeerDependencies: - encoding @@ -9848,25 +9848,25 @@ snapshots: '@azimutt/connector-couchbase@0.1.2': dependencies: - '@azimutt/models': 0.1.15 - '@azimutt/utils': 0.1.6 + '@azimutt/models': 0.1.16 + '@azimutt/utils': 0.1.7 couchbase: 4.3.1 transitivePeerDependencies: - encoding - supports-color - '@azimutt/connector-mariadb@0.1.6': + '@azimutt/connector-mariadb@0.1.7': dependencies: - '@azimutt/models': 0.1.15 - '@azimutt/utils': 0.1.6 + '@azimutt/models': 0.1.16 + '@azimutt/utils': 0.1.7 mariadb: 3.3.1 transitivePeerDependencies: - encoding '@azimutt/connector-mongodb@0.1.4(socks@2.8.3)': dependencies: - '@azimutt/models': 0.1.15 - '@azimutt/utils': 0.1.6 + '@azimutt/models': 0.1.16 + '@azimutt/utils': 0.1.7 mongodb: 6.8.0(socks@2.8.3) transitivePeerDependencies: - '@aws-sdk/credential-providers' @@ -9880,24 +9880,24 @@ snapshots: '@azimutt/connector-mysql@0.1.5': dependencies: - '@azimutt/models': 0.1.15 - '@azimutt/utils': 0.1.6 + '@azimutt/models': 0.1.16 + '@azimutt/utils': 0.1.7 mysql2: 3.3.5 transitivePeerDependencies: - encoding '@azimutt/connector-oracle@0.1.3': dependencies: - '@azimutt/models': 0.1.15 - '@azimutt/utils': 0.1.6 + '@azimutt/models': 0.1.16 + '@azimutt/utils': 0.1.7 oracledb: 6.6.0 transitivePeerDependencies: - encoding '@azimutt/connector-postgres@0.1.11(pg-native@3.0.1)': dependencies: - '@azimutt/models': 0.1.15 - '@azimutt/utils': 0.1.6 + '@azimutt/models': 0.1.16 + '@azimutt/utils': 0.1.7 pg: 8.12.0(pg-native@3.0.1) postgres-array: 3.0.2 transitivePeerDependencies: @@ -9906,8 +9906,8 @@ snapshots: '@azimutt/connector-snowflake@0.1.2(asn1.js@5.4.1)': dependencies: - '@azimutt/models': 0.1.15 - '@azimutt/utils': 0.1.6 + '@azimutt/models': 0.1.16 + '@azimutt/utils': 0.1.7 snowflake-sdk: 1.10.1(asn1.js@5.4.1)(encoding@0.1.13) transitivePeerDependencies: - asn1.js @@ -9917,23 +9917,23 @@ snapshots: '@azimutt/connector-sqlserver@0.1.4': dependencies: - '@azimutt/models': 0.1.15 - '@azimutt/utils': 0.1.6 + '@azimutt/models': 0.1.16 + '@azimutt/utils': 0.1.7 mssql: 11.0.1 transitivePeerDependencies: - encoding - supports-color - '@azimutt/models@0.1.15': + '@azimutt/models@0.1.16': dependencies: - '@azimutt/utils': 0.1.6 + '@azimutt/utils': 0.1.7 openai: 4.65.0(encoding@0.1.13)(zod@3.23.8) zod: 3.23.8 zod-to-json-schema: 3.23.3(zod@3.23.8) transitivePeerDependencies: - encoding - '@azimutt/utils@0.1.6': {} + '@azimutt/utils@0.1.7': {} '@azure/abort-controller@2.1.2': dependencies: