diff --git a/.github/workflows/generate.yaml b/.github/workflows/generate.yaml index 73dba77..65b8cd6 100644 --- a/.github/workflows/generate.yaml +++ b/.github/workflows/generate.yaml @@ -1,4 +1,4 @@ -name: generate +name: Generate PostgreSQL Error Codes on: schedule: @@ -13,23 +13,23 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.4' - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Generate - run: make + - name: Generate PostgreSQL Error Codes + uses: nick-fields/retry@v3 + with: + timeout_seconds: 60 + max_attempts: 3 + command: make - - name: Count changes - id: changes - run: | - git add -N . - git diff --name-only --exit-code - continue-on-error: true + - name: Syntax check + run: php -l -n -d error_reporting=E_ALL ./src/PostgresError.php - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 + uses: peter-evans/create-pull-request@v6 with: commit-message: Update Error Code delete-branch: true @@ -38,4 +38,3 @@ jobs: Error codes have been updated. - https://github.com/postgres/postgres/blob/master/src/backend/utils/errcodes.txt - if: steps.changes.outcome == 'failure' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e430a77..196c8bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,10 @@ on: jobs: test: runs-on: ${{ matrix.os }} + + env: + latest_php: 8.4 + strategy: fail-fast: false matrix: @@ -16,7 +20,7 @@ jobs: php: [ '5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', - '8.0', '8.1', '8.2', '8.3' + '8.0', '8.1', '8.2', '8.3', '8.4', ] name: PHP ${{ matrix.php }} @@ -30,21 +34,25 @@ jobs: tools: composer:v2 - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install dependencies - run: composer install --quiet --no-ansi --prefer-dist --no-progress --no-interaction + uses: nick-fields/retry@v3 + with: + timeout_seconds: 60 + max_attempts: 3 + command: composer install --quiet --no-plugins --no-ansi --prefer-dist --no-progress --no-interaction - name: Migrate phpunit XML configuration - continue-on-error: true - run: vendor/bin/phpunit --migrate-configuration + run: vendor/bin/phpunit --migrate-configuration || true - name: Run test suite run: vendor/bin/phpunit --coverage-clover=coverage.xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./coverage.xml fail_ci_if_error: false + if: matrix.php == env.latest_php diff --git a/LICENSE b/LICENSE index a907a5d..4f46ec2 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020-2021 Norifumi SUNAOKA +Copyright (c) 2020-2025 Norifumi SUNAOKA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/phpunit.xml b/phpunit.xml index 317ab46..16e7d4b 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,20 +1,13 @@ - - ./tests + ./tests diff --git a/src/PostgresError.php b/src/PostgresError.php index 7bf5661..3a23e75 100644 --- a/src/PostgresError.php +++ b/src/PostgresError.php @@ -57,6 +57,9 @@ class PostgresError const DIAGNOSTICS_EXCEPTION = '0Z000'; const STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER = '0Z002'; + // Class 10 - XQuery Error + const INVALID_ARGUMENT_FOR_XQUERY = '10608'; + // Class 20 - Case Not Found const CASE_NOT_FOUND = '20000'; @@ -158,6 +161,7 @@ class PostgresError const NO_ACTIVE_SQL_TRANSACTION = '25P01'; const IN_FAILED_SQL_TRANSACTION = '25P02'; const IDLE_IN_TRANSACTION_SESSION_TIMEOUT = '25P03'; + const TRANSACTION_TIMEOUT = '25P04'; // Class 26 - Invalid SQL Statement Name const INVALID_SQL_STATEMENT_NAME = '26000'; @@ -301,6 +305,7 @@ class PostgresError const IO_ERROR = '58030'; const UNDEFINED_FILE = '58P01'; const DUPLICATE_FILE = '58P02'; + const FILE_NAME_TOO_LONG = '58P03'; // Class F0 - Configuration File Error const CONFIG_FILE_ERROR = 'F0000';