Download the PHP package neat/database without Composer

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

Neat Database components

Stable Version Build Status

Neat database components provide a clean and expressive API for accessing your databases. At its core is the Connection which uses a PDO instance underneath.

Getting started

To install this package, simply issue composer on the command line:

Then create a new database connection

Querying

Fetching information from the database is straightforward with the and methods. They both return a object that allows you to fetch and by calling its equally named methods.

Traversing results

In most cases, when you fetch a multi-row result, you'll want to iterate over the results row by row. This may seem trivial, but there are several ways to go about this.

Fetched results

To use a result multiple times (for example to count its rows and then return all the rows), you'll need to the result first. A live result wouldn't allow you to do this:

Manipulation

Because non-select queries never return a result, it wouldn't make sense to use the same result api either. Instead, the number of rows affected by your query would be nice to work with... which is exactly what the method gives you.

Notice how an insert with only 2 fields already gets quite long and unreadable. Because these data manipulation queries are often filled with data from arrays, it makes sense to use a specialized api for this purpose too.

Enter the , and methods. Like the method, these methods also return the number of rows affected.

Please note that the insert method does NOT return the last inserted id, instead you'll have to use the method.

Query building

To assist in writing queries within your code, you can use the query builder. It allows you to incrementally compose a query without having to worry about SQL syntax and concatenation yourself.

The query builder can be retrieved by calling the or method. By chaining method calls, you can interactively build your query and access the result by using the result api or convert the query to its string representation using a typecast or its get* methods.

The , and methods also return a query builder instance when you don't pass all their parameters.

Escaping and quoting

When the built-in query builder and placeholder substitution simply don't cut it anymore, you'll most likely end up concatenating your own SQL queries. The and methods allow you to safely embed literal values and identifiers into your own SQL statements.

Transactions and locking

If you want to run a set of database operations within a transaction, you can use the transaction method and pass your operations as a closure. When the closure returns, the transaction will be automatically committed. But if an exception is thrown, the transaction will rollback itself.


All versions of database with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.0
psr/log Version ^1.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 neat/database contains the following files

Loading the files please wait ....