keboola / php-load-type-decider
Single source of truth for Keboola workspace table load-type decisions (COPY/CLONE/VIEW)
Requires
- php: >=8.2
- keboola/common-exceptions: ^1
Requires (Dev)
- keboola/coding-standard: ^16.0
- php-parallel-lint/php-parallel-lint: ^1.3
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11|^12
- squizlabs/php_codesniffer: ^3 || ^4
- dev-master
- dev-codex/dmd-1274-double-update-codex
- dev-gh-readonly-queue/master/pr-7549-aa554516d237fc1fe86b5a724528c3fdee35e3b2
- dev-gh-readonly-queue/master/pr-7555-e8b11bcbaf9999eaf54a2673af1ba79f577979b5
- dev-gh-readonly-queue/master/pr-7556-82f56a8ccc4f6fd261618bf6aafab0734bbd2db5
- dev-roman/global-search-project-rollout
- dev-roman/migrate-table-data-preview
- dev-vb/DMD-1518/bq_key_project_entity
- dev-vb/async_email_phase_5_subscriber_migration
- dev-vb/review-changes-skill-parity-check
- dev-zajca/dmd-1356/cli-auth-e2e-tooling
This package is auto-updated.
Last update: 2026-06-05 13:35:57 UTC
README
Single source of truth for Keboola's workspace table load-type decision — which mechanism the server uses to load a Storage table into a workspace:
COPY— always available fallback.CLONE— zero-copy, identical row semantics (Snowflake / BigQuery).VIEW— live view over the source table.
The library is intentionally dependency-free of the platform: it never reads
features from a database or talks to any backend. The caller resolves project
features one level up and passes them in as plain booleans via
LoadTypeDeciderFeatures. This keeps the decision logic centralized, pure, and
trivially testable.
Installation
composer require keboola/php-load-type-decider
Usage
use Keboola\LoadTypeDecider\LoadTypeDecider; use Keboola\LoadTypeDecider\LoadTypeDeciderFeatures; $decision = LoadTypeDecider::decide( $tableInfo, // Storage API table detail $workspaceType, // 'snowflake' | 'bigquery' $exportOptions, // options about to be passed to the workspace load new LoadTypeDeciderFeatures( bigqueryDefaultImView: false, snowflakeReadOnlyStorage: true, ), ); $decision->preferred; // LoadType the server picks when none is pinned $decision->possible; // full set the caller may choose from (always contains COPY)
Call LoadTypeDecider::checkViableLoadMethod() before deciding to reject loads
that no method can satisfy (throws Exception\InvalidInputException).
Development
This package is developed inside the keboola/connection monorepo and mirrored read-only to keboola/php-load-type-decider. Open pull requests against the monorepo.
composer install
composer ci # lint + phpcs + phpstan + tests
License
MIT — see LICENSE.