diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..000d73e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..515b5ef --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,72 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '28 0 * * 2' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'javascript' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + + # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs + # queries: security-extended,security-and-quality + + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun + + # If the Autobuild fails above, remove it and uncomment the following three lines. + # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. + + # - run: | + # echo "Run, Build Application using script" + # ./location_of_script_within_repo/buildscript.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.npmignore b/.npmignore index 41dde7a..cefe593 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,6 @@ node_modules src .gitignore +.github tsconfig.json .idea diff --git a/package-lock.json b/package-lock.json index f1bbe96..d888f0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,16 +1,137 @@ { "name": "mysqlx", - "version": "1.1.6", - "lockfileVersion": 1, + "version": "1.1.7", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "mysqlx", + "version": "1.1.7", + "license": "Apache-2.0", + "dependencies": { + "@mysql/xdevapi": "^8.0.20", + "lodash.isboolean": "^3.0.3", + "lodash.isnumber": "^3.0.3", + "lodash.isstring": "^4.0.1" + }, + "devDependencies": { + "@types/lodash.isboolean": "^3.0.6", + "@types/lodash.isnumber": "^3.0.6", + "@types/lodash.isstring": "^4.0.6", + "@types/node": "^17.0.31", + "dotenv": "^16.0.0", + "prettier": "^2.0.5" + } + }, + "node_modules/@mysql/xdevapi": { + "version": "8.0.29", + "resolved": "https://registry.npmjs.org/@mysql/xdevapi/-/xdevapi-8.0.29.tgz", + "integrity": "sha512-9E6+g9fKBu2mhLEnYfr+KKRyb5W52Z01NkBrgS3uQA7MweZmlLV/pMlAP27J5GfBsW2okP8gnm3Dkrj0ZhfR2Q==", + "dependencies": { + "google-protobuf": "3.19.4", + "parsimmon": "1.16.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@types/lodash": { + "version": "4.14.155", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.155.tgz", + "integrity": "sha512-vEcX7S7aPhsBCivxMwAANQburHBtfN9RdyXFk84IJmu2Z4Hkg1tOFgaslRiEqqvoLtbCBi6ika1EMspE+NZ9Lg==", + "dev": true + }, + "node_modules/@types/lodash.isboolean": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/lodash.isboolean/-/lodash.isboolean-3.0.7.tgz", + "integrity": "sha512-pQkjcu8A9aZPNLTxQ60zWI8Yqs1Qzd6ni8dhcax45oJgWWbiDcwEVAQDwxC+NucW337xhRMLxR1yh+Eb8R2YOQ==", + "dev": true, + "dependencies": { + "@types/lodash": "*" + } + }, + "node_modules/@types/lodash.isnumber": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/lodash.isnumber/-/lodash.isnumber-3.0.7.tgz", + "integrity": "sha512-+XX8YsZ6AzWg6ukTB2g6TdL4gK6wUxIeakYV849gHoTYsb2IH0SyAywfF1xutE/EBbT3CospyfABcl9gZKD23g==", + "dev": true, + "dependencies": { + "@types/lodash": "*" + } + }, + "node_modules/@types/lodash.isstring": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@types/lodash.isstring/-/lodash.isstring-4.0.7.tgz", + "integrity": "sha512-gt4q4n1Who4JxLeFR/kduS2Tia+biQk/zdbIkOfMvAldXHJdcC5SsvZREchkwa4CwKK+DqhIm3wfigFYzNKS8Q==", + "dev": true, + "dependencies": { + "@types/lodash": "*" + } + }, + "node_modules/@types/node": { + "version": "17.0.31", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz", + "integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==", + "dev": true + }, + "node_modules/dotenv": { + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", + "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/google-protobuf": { + "version": "3.19.4", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.19.4.tgz", + "integrity": "sha512-OIPNCxsG2lkIvf+P5FNfJ/Km95CsXOBecS9ZcAU6m2Rq3svc0Apl9nB3GMDNKfQ9asNv4KjyAqGwPQFrVle3Yg==" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "node_modules/parsimmon": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.16.0.tgz", + "integrity": "sha512-tekGDz2Lny27SQ/5DzJdIK0lqsWwZ667SCLFIDCxaZM7VNgQjyKLbaL7FYPKpbjdxNAXFV/mSxkq5D2fnkW4pA==" + }, + "node_modules/prettier": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + } + }, "dependencies": { "@mysql/xdevapi": { - "version": "8.0.20", - "resolved": "https://registry.npmjs.org/@mysql/xdevapi/-/xdevapi-8.0.20.tgz", - "integrity": "sha512-7XIMfrl4S76NV2vkIbiIvdHR75po+LgqokscIdH1Te1bhLFjEIcHnpCiDUXWSK7z1HiJndNnZovg+s5qEs5eNQ==", + "version": "8.0.29", + "resolved": "https://registry.npmjs.org/@mysql/xdevapi/-/xdevapi-8.0.29.tgz", + "integrity": "sha512-9E6+g9fKBu2mhLEnYfr+KKRyb5W52Z01NkBrgS3uQA7MweZmlLV/pMlAP27J5GfBsW2okP8gnm3Dkrj0ZhfR2Q==", "requires": { - "google-protobuf": "3.4.0", - "parsimmon": "1.6.2" + "google-protobuf": "3.19.4", + "parsimmon": "1.16.0" } }, "@types/lodash": { @@ -20,48 +141,48 @@ "dev": true }, "@types/lodash.isboolean": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@types/lodash.isboolean/-/lodash.isboolean-3.0.6.tgz", - "integrity": "sha512-9ommZgIE6GlZW/GuSRIOSJP3X0FkOD2qqt8xBNqUVb/t4L62WiIGCPgIKK2PNfZem7bEZulM0djX9f8IG2Qg3Q==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/lodash.isboolean/-/lodash.isboolean-3.0.7.tgz", + "integrity": "sha512-pQkjcu8A9aZPNLTxQ60zWI8Yqs1Qzd6ni8dhcax45oJgWWbiDcwEVAQDwxC+NucW337xhRMLxR1yh+Eb8R2YOQ==", "dev": true, "requires": { "@types/lodash": "*" } }, "@types/lodash.isnumber": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@types/lodash.isnumber/-/lodash.isnumber-3.0.6.tgz", - "integrity": "sha512-nnfRqgijLFBEVu8W6pkHGq4hefaQOMcVwqeY19qIpf4qhV04mczNZvyT4Hc8UjOcnCIXErQG0aqIJedqlbbvVw==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@types/lodash.isnumber/-/lodash.isnumber-3.0.7.tgz", + "integrity": "sha512-+XX8YsZ6AzWg6ukTB2g6TdL4gK6wUxIeakYV849gHoTYsb2IH0SyAywfF1xutE/EBbT3CospyfABcl9gZKD23g==", "dev": true, "requires": { "@types/lodash": "*" } }, "@types/lodash.isstring": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@types/lodash.isstring/-/lodash.isstring-4.0.6.tgz", - "integrity": "sha512-uUGvF9G1G7jQ5H42Y38GA9rZmUoY8wI/OMSwnW0BZA+Ra0uxzpuQf4CixXl3yG3TvF6LjuduMyt1WvKl+je8QA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@types/lodash.isstring/-/lodash.isstring-4.0.7.tgz", + "integrity": "sha512-gt4q4n1Who4JxLeFR/kduS2Tia+biQk/zdbIkOfMvAldXHJdcC5SsvZREchkwa4CwKK+DqhIm3wfigFYzNKS8Q==", "dev": true, "requires": { "@types/lodash": "*" } }, "@types/node": { - "version": "14.0.13", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.13.tgz", - "integrity": "sha512-rouEWBImiRaSJsVA+ITTFM6ZxibuAlTuNOCyxVbwreu6k6+ujs7DfnU9o+PShFhET78pMBl3eH+AGSI5eOTkPA==", + "version": "17.0.31", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.31.tgz", + "integrity": "sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q==", "dev": true }, "dotenv": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", - "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==", + "version": "16.0.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.0.tgz", + "integrity": "sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==", "dev": true }, "google-protobuf": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.4.0.tgz", - "integrity": "sha512-8gq3CyAZFyHJ5dZ0Du/OztbwxEHhHTNOtfr1cSUQYuW6lsrKjMU2DETvOlxPpYNKZ7zAW4xEE7UWqrTxH7bG6Q==" + "version": "3.19.4", + "resolved": "https://registry.npmjs.org/google-protobuf/-/google-protobuf-3.19.4.tgz", + "integrity": "sha512-OIPNCxsG2lkIvf+P5FNfJ/Km95CsXOBecS9ZcAU6m2Rq3svc0Apl9nB3GMDNKfQ9asNv4KjyAqGwPQFrVle3Yg==" }, "lodash.isboolean": { "version": "3.0.3", @@ -79,14 +200,14 @@ "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" }, "parsimmon": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.6.2.tgz", - "integrity": "sha512-bJNB0ZQhHyM5KqO2Z5ttQAVn/PZ2pccxaOnMcZ0Su7HA1Iv4GQTfUmzSZ6N3jcsCn9F68PZcypAvF3nDRRL+3g==" + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.16.0.tgz", + "integrity": "sha512-tekGDz2Lny27SQ/5DzJdIK0lqsWwZ667SCLFIDCxaZM7VNgQjyKLbaL7FYPKpbjdxNAXFV/mSxkq5D2fnkW4pA==" }, "prettier": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", - "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", + "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", "dev": true } } diff --git a/package.json b/package.json index 8e591a0..d47e022 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mysqlx", - "version": "1.1.7", + "version": "1.1.8", "description": "Staticly typed MySQL Connector for NodeJS using the X Protocol.", "main": "lib/mysqlx.js", "repository": "https://github.com/danang-id/mysqlx.git", @@ -17,8 +17,8 @@ "@types/lodash.isboolean": "^3.0.6", "@types/lodash.isnumber": "^3.0.6", "@types/lodash.isstring": "^4.0.6", - "@types/node": "^14.0.13", - "dotenv": "^8.2.0", + "@types/node": "^17.0.31", + "dotenv": "^16.0.0", "prettier": "^2.0.5" }, "scripts": { diff --git a/src/SelectOperationResult.ts b/src/SelectOperationResult.ts index a9be20f..1a1f429 100644 --- a/src/SelectOperationResult.ts +++ b/src/SelectOperationResult.ts @@ -38,6 +38,10 @@ export class SelectOperationResult extends OperationResult implements ISelectOpe } } + fetchAll(): Row[][] { + return this.rows + } + public getRows(): Row[][] { return this.rows } diff --git a/src/interfaces/ISelectOperationResult.ts b/src/interfaces/ISelectOperationResult.ts index 5bb9b18..eff6e6e 100644 --- a/src/interfaces/ISelectOperationResult.ts +++ b/src/interfaces/ISelectOperationResult.ts @@ -25,6 +25,7 @@ export interface ISelectOperationResult { getRows(): Row[][] getMetadata(): Metadata getObjects(): Object[] + fetchAll(): Row[][] } export default ISelectOperationResult