Download the PHP package ascetic-soft/rowcast without Composer

On this page you can find all versions of the php package ascetic-soft/rowcast. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rowcast

Rowcast

CI codecov PHPStan Level 9 Latest Stable Version Total Downloads PHP Version License

Lightweight DataMapper over PDO for PHP 8.4+.

Rowcast maps database rows to DTOs and back using reflection, supports explicit/auto mapping, type conversion, and includes a fluent query builder with dialect-aware UPSERT.

Documentation: English | Русский | LLM/Context7

Requirements

Installation

Quick Start

Core Concepts

Rowcast supports two mapping styles:

Auto Mapping

Table name is derived from DTO class name for reads:

Class Table
User users
UserProfile user_profiles

Column/property conversion (default):

Column Property
created_at createdAt
is_active isActive

Explicit Mapping

Use Mapping::explicit(...) when only declared columns must be used:

Notes:

Connection

Connection wraps PDO and provides query helpers, transaction API, nested transaction support (savepoints), and query-builder factory.

Create Connection

Raw Queries

Query Events

Register lightweight listeners to observe SQL execution.

Transactions

Nested mode creates savepoints for inner transactions.

DataMapper API

Main methods:

CRUD Example

save(...) Example

save(...) checks row existence by identity columns, then performs insert or update.

Notes:

upsert(...) Example

Batch operations

batchInsert and batchUpsert automatically split large input into chunks based on DB parameter limits (for example, SQLite: 999 bind params), while executing all chunks inside one transaction.

Advanced where in DataMapper

DataMapper passes where arrays to the same QueryBuilder condition engine, so advanced operators are available there as well:

Type Conversion

Rowcast converts DB values to declared PHP property types on hydrate, and PHP values to DB-safe values on extract/write.

Built-in converters:

Custom Type Converter

Implement TypeConverterInterface and pass a custom registry to DataMapper:

Custom Name Converter

Implement NameConverterInterface and pass it to DataMapper:

Query Builder

Connection::createQueryBuilder() provides a fluent SQL builder.

SELECT

For pagination, use:

You can also pass associative arrays to where(), andWhere(), and orWhere():

array predicates are converted to field = :param expressions joined by AND:

Parameter names are generated automatically and made unique (:w_id, :w_id_1, ...).

Supported array operators:

Operator reference:

Input Example SQL fragment (shape)
Equality ['id' => 10] id = :w_id
IS NULL ['deleted_at' => null] deleted_at IS NULL
IS NOT NULL ['deleted_at !=' => null] deleted_at IS NOT NULL
IN (auto) ['status' => ['active', 'pending']] status IN (:w_status, :w_status_1)
NOT IN (auto) ['status !=' => ['banned']] status NOT IN (:w_status, ...)
IN (explicit) ['status IN' => ['active']] status IN (:w_status)
NOT IN (explicit) ['status NOT IN' => ['banned']] status NOT IN (:w_status)
Comparison ['age >=' => 18] age >= :w_age
LIKE ['name LIKE' => 'A%'] name LIKE :w_name
ILIKE ['name ILIKE' => 'a%'] name ILIKE :w_name
NOT LIKE ['name NOT LIKE' => '%bot%'] name NOT LIKE :w_name
NOT ILIKE ['name NOT ILIKE' => '%bot%'] name NOT ILIKE :w_name
BETWEEN ['age BETWEEN' => [18, 65]] age BETWEEN :w_age AND :w_age_1

Notes:

Dialect-specific operator support:

Dialect Extra operators over base set
PostgreSQL (pgsql) ILIKE, NOT ILIKE
MySQL (mysql) none
SQLite (sqlite) none
Generic/other drivers none

Base set for all dialects: >, >=, <, <=, LIKE, NOT LIKE.

OR Conditions

You can compose OR logic in two ways.

Method-based OR groups:

Combine with existing filters:

Nested-key style in one array:

OR composition reference:

Pattern Example SQL fragment (shape)
whereOr(...groups) ->whereOr(['status' => 'active'], ['role' => 'admin']) ((status = :w_status) OR (role = :w_role))
andWhereOr(...groups) ->where(['deleted_at' => null])->andWhereOr(['status' => 'active'], ['role' => 'admin']) deleted_at IS NULL AND ((status = :w_status) OR (role = :w_role))
$or inside where([...]) ->where(['age >' => 18, '$or' => [['status' => 'active'], ['role' => 'admin']]]) age > :w_age AND ((status = :w_status) OR (role = :w_role))
$and inside $or ->where(['$or' => [['status' => 'active'], ['$and' => [['role' => 'admin'], ['verified' => true]]]]]) ((status = :w_status) OR ((role = :w_role) AND (verified = :w_verified)))
Mixed operators in OR groups ->whereOr(['status' => ['active', 'pending'], 'deleted_at' => null], ['name LIKE' => 'A%', 'age BETWEEN' => [18, 65]]) ((status IN (...) AND deleted_at IS NULL) OR (name LIKE :w_name AND age BETWEEN :w_age AND :w_age_1))

INSERT / UPDATE / DELETE

UPSERT

Upsert is compiled via SQL dialects:

WHERE array operator support is also dialect-aware (for example, ILIKE/NOT ILIKE only for PostgreSQL).

Architecture

Development

License

MIT


All versions of rowcast with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-pdo Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ascetic-soft/rowcast contains the following files

Loading the files please wait ...