diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 063fb091..d7382c62 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -31,3 +31,10 @@ jobs: - uses: JS-DevTools/npm-publish@v3 with: token: ${{ secrets.NPM_TOKEN }} + - name: Create a Release + uses: elgohr/Github-Release-Action@v5 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + title: ${{ github.ref }} + tag: ${{ github.ref }} diff --git a/cpp/bridge.cpp b/cpp/bridge.cpp index 590468c6..59e5ec13 100644 --- a/cpp/bridge.cpp +++ b/cpp/bridge.cpp @@ -742,9 +742,11 @@ opsqlite_execute_raw(std::string const &dbName, std::string const &query, opsqlite_bind_statement(statement, params); } - int i, count, column_type; + int i, column_type; std::string column_name, column_declared_type; + int column_count = sqlite3_column_count(statement); + while (isConsuming) { step = sqlite3_step(statement); @@ -755,25 +757,15 @@ opsqlite_execute_raw(std::string const &dbName, std::string const &query, } std::vector row; + row.reserve(column_count); i = 0; - count = sqlite3_column_count(statement); - - while (i < count) { + while (i < column_count) { column_type = sqlite3_column_type(statement, i); switch (column_type) { - case SQLITE_INTEGER: { - /** - * Warning this will loose precision because JS can - * only represent Integers up to 53 bits - */ - double column_value = sqlite3_column_double(statement, i); - row.emplace_back(column_value); - break; - } - + case SQLITE_INTEGER: case SQLITE_FLOAT: { double column_value = sqlite3_column_double(statement, i); row.emplace_back(column_value); @@ -809,7 +801,7 @@ opsqlite_execute_raw(std::string const &dbName, std::string const &query, i++; } - results->push_back(row); + results->emplace_back(row); break; } @@ -871,7 +863,7 @@ std::string operation_to_string(int operation_type) { return "UPDATE"; default: - throw std::invalid_argument("Uknown SQLite operation on hook"); + throw std::invalid_argument("Unknown SQLite operation on hook"); } } diff --git a/scripts/release.sh b/scripts/release.sh index b773f636..05b8a10e 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -2,9 +2,9 @@ set -ex npm --no-git-tag-version version $1 VERSION=$(node -p "require('./package.json').version") -echo "Releasing $VERSION" + git add . git commit -m "Release $VERSION" git push git tag "$VERSION" -git push --tags \ No newline at end of file +git push --tags \ No newline at end of file