Download the PHP package xwero/idable-queries-relational without Composer

On this page you can find all versions of the php package xwero/idable-queries-relational. 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 idable-queries-relational

Idable queries: relational package

This package provides the functions to execute SQL queries on relational databases.

Overview

Idable queries are a set of packages that are at the core a multi-database wrapper. While you can use it as a wrapper with the same functions and types per database, the libraries provide an abstraction for the database names and parameters. At the base of the abstraction is the Identifier interface. It is nothing more than a library specific name for enums.

` A backed enum is recommended to separate database name from the enum name.

A SQL query, SELECT name FROM users WHERE name = 'me';, can now be written as SELECT ~Users:Name FROM ~Users:Users WHERE ~Users:Name = :Users:Name;. A Redis query like HMSET users name "Hello" email "World" can be written as HMSET ~Users:Users ~Users:Name :Users:Name ~Users:Email :Users:Email. And so on with other database types.

note: The placeholders are case-insensitive, but for the best compilation path in PHP it is recommended to use capitals.> note: The placeholders are case-insensitive, but for the best compilation path in PHP it is recommended to use capitals.

To make it easier to add multiple parameters an CustomParameterIdentifier attribute can be added to an Identifier instance. This signals to the parameter functions that the parameter value will use a transformer to replace a single placeholder.

Now the Redis query can be written asHMSET ~Users:Users :Set:Users. And depending on the values in theIdableParameterCollectioninstance the query will be changed. Each database package will have predefined transformer functions. Creating theIdentifier` instance is up to the implementers.

The libraries will have map functions that transform the result of the query in an array-like structure where the key is an Identifier instance. As an example the SELECT ~Users:Name FROM ~Users:Users WHERE ~Users:Name = :Users:Name; query result called with the createMapFromFirstLevelResults function will have the $map[Users:Name] value me. This prevents typos when using the results.

The libraries are build with utility in mind. That is why the main functionality is in the functions, rather than in objects. Use as much or as little as you like.

Functions

buildStatement

Transforms a query into a Statement. This will be the start of the chain in most cases.

For the parameters it is possible to use a IdableParameterCollection or an array depending on the placeholders in the query.

executeStatement

Executes and optionally returns data for the prepared Statement. An output config can be added to make it consistent. Read more about the output behavior in the Statement section.

executeTransaction

Allows to execute multiple Statement instances. On Error a rollback will be executed.

getFirstLevelMap

This is a convenience function that combines getRow and createMapFromFirstLevelResults.

getSecondLevelMapCollection

This is a convenience function that combines getRows and createMapFromSecondLevelResults.

inArrayParameterTransformer

This function is used as the argument of the CustomParameterIdentifier attribute when an IN parameter needs to be replaced.

multiInsertParameterTransformer

This function is used as the argument of the CustomParameterIdentifier attribute when multi insert values need to be replaced.

PDOfyParameterPlaceholder

Makes sure a SQL database is not going to complain about characters it doesn't accept.

Is used by the buildStatement function.

Types

Connection

Implementation of the RelationalConnection interface

The class configures a few things on the PDO instance:

This means $staement = $connection->client->prepare('SELECT * FROM users;') can be used with the functions that use a Statement instance as input.

QueryReturnConfigRelational

Manipulate the output of the executeStatement function and Statement->run method with different booleans.

The trueOnSuccess boolean is in this package less useful as the underlying database methods also return a boolean.

RelationalConnection

Interface for the connection class.

Statement

Class to create a consistent language. It exposes the PDO instance with the client property and the queryString property exposes the database query.

This class has the methods:

note: The least amount of data is based on the row amount and the field amount. For example, a single row with a single field return the value of the field instead of an array. If you want a consistent use the config argument.

Tips


All versions of idable-queries-relational with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-pdo Version *
xwero/idable-queries-core Version ^0.3.0
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 xwero/idable-queries-relational contains the following files

Loading the files please wait ...