Download the PHP package aryelgois/yasql-php without Composer

On this page you can find all versions of the php package aryelgois/yasql-php. 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 yasql-php

YASQL-PHP

Index:

Intro

This is a PHP implementation for YAML Ain't SQL, whose specification can be found in aryelgois/yasql.

Install

Enter the terminal, navigate to your project root and run:

composer require aryelgois/yasql-php

Setup

This package provides CLI tools to work with YASQL files. To use them, add the following in your composer.json:

You also need a config file for the builder command. The default is to place it in config/databases.yml, but you can choose another place or have more than one configuration.
(see Builder specifications)

Usage

yasql-build

First, create databases following the YASQL schema and list them in your config file. Then run the following command in your project root:

Notes:

This command creates .sql files in the output directory, so you can import them into your sql server.

yasql-generate

If you only want to generate the SQL from one YASQL schema, run the following command:

composer yasql-generate -- path/to/yasql.yml [ indentation ]

The first argument is the path to a YASQL file, the second is a optional indentation to be used (default is 2 spaces).

It will output to stdout, so you can add something like > output_database.sql to write the result in a file.

API

This package provides some classes to parse YASQL and generate SQL. They are under the namespace aryelgois\YaSql.

Composer

Provides Composer scripts to use this package from the command line.
(see how to configure the commands in Setup)

Controller

This class wrapps others, to make them easier to use.

Parser

Generator

Builder

config file

A YAML with the following keys: (all are optional)

Example:

The post file is useful for pre populated rows or to apply sql commands not covered by YASQL specification. Its content is appended to the generated sql.

Populator

A helper class for Builder. Use it to generate INSERT INTO statements to populate your databases.

This class is abstract, so you have to write a class that extends it. The reason is that the YAML with the data might be in a arbitrary layout, depending on your database schema.

To use it, you need a special post in the builder config:

Example from aryelgois/databases:

The post must map to a sequence, and the desired item is a map of:

Utils

There is also a class with utility methods. They are used internally and can be used by whoever requires this package.

Changelog


All versions of yasql-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
symfony/yaml Version ^3.4
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 aryelgois/yasql-php contains the following files

Loading the files please wait ....