PHPackages                             jaxonrailey/vane - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. jaxonrailey/vane

ActiveLibrary

jaxonrailey/vane
================

My Composer package

1.0.0(3y ago)57PHP

Since Apr 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/JaxonRailey/php-package-vane)[ Packagist](https://packagist.org/packages/jaxonrailey/vane)[ RSS](/packages/jaxonrailey-vane/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Vane
====

[](#vane)

**Vane** is a PHP package that allows you to query a document in nodes, therefore with the typical structure of a noSQL database, but using a familiar and intuitive syntax, through methods inspired by the SQL language.

Installation
------------

[](#installation)

To install the package, run this command from a terminal

```
composer require jaxonrailey/vane

```

How to use
----------

[](#how-to-use)

Once installed, include the namespace

```
use JaxonRailey\Vane;
```

Initialize an instance of **Vane**

```
$vane = new Vane();
```

Example
-------

[](#example)

Consider the following array on which we will do some queries:

```
$planets = [
    [
        'name'        => 'mercury',
        'temperature' => 440,
        'distance'    => 57910000,
        'satellites'  => 0,
        'atmosphere'  => [],
        'discoverer'  => [
            'firstname'   => 'Giovanni',
            'lastname'    => 'Schiaparelli',
            'nationality' => 'Italian'
        ]
    ],
    [
        'name'        => 'venus',
        'temperature' => 737,
        'distance'    => 108200000,
        'satellites'  => 0,
        'atmosphere'  => ['nitrogen', 'water', 'argon'],
        'discoverer'  => [
            'firstname'   => 'Giovanni',
            'lastname'    => 'Cassini',
            'nationality' => 'Italian'
        ]
    ],
    [
        'name'        => 'earth',
        'temperature' => 15,
        'distance'    => 149600000,
        'satellites'  => 1,
        'atmosphere'  => ['nitrogen', 'oxygen', 'water', 'neon']
    ],
    [
        'name'        => 'mars',
        'temperature' => -63,
        'distance'    => 227940000,
        'satellites'  => 2,
        'atmosphere'  => ['nitrogen', 'argon', 'oxygen', 'water'],
        'discoverer'  => [
            'firstname'   => 'Edward',
            'lastname'    => 'Barnard',
            'nationality' => 'American'
        ]
    ],
    [
        'name'        => 'jupiter',
        'temperature' => -108,
        'distance'    => 778330000,
        'satellites'  => 79,
        'atmosphere'  => ['hydrogen', 'helium', 'methane'],
        'discoverer'  => [
            'firstname'   => 'Galileo',
            'lastname'    => 'Galilei',
            'nationality' => 'Italian'
        ]
    ],
    [
        'name'        => 'saturn',
        'temperature' => -139,
        'distance'    => 1429400000,
        'satellites'  => 82,
        'atmosphere'  => ['hydrogen', 'helium', 'methane'],
        'discoverer'  => [
            'firstname'   => 'Galileo',
            'lastname'    => 'Galilei',
            'nationality' => 'Italian'
        ]
    ],
    [
        'name'        => 'uranus',
        'temperature' => -197,
        'distance'    => 2870990000,
        'satellites'  => 27,
        'atmosphere'  => ['hydrogen', 'helium', 'methane', 'water'],
        'discoverer'  => [
            'firstname'   => 'William',
            'lastname'    => 'Herschel',
            'nationality' => 'German-British'
        ]
    ],
    [
        'name'        => 'neptune',
        'temperature' => -201,
        'distance'    => 4504300000,
        'satellites'  => 14,
        'atmosphere'  => ['hydrogen', 'helium', 'methane', 'water'],
        'discoverer'  => [
            'firstname'   => 'Urbain',
            'lastname'    => 'Le Verrier',
            'nationality' => 'French'
        ]
    ]
];
```

Basic use
---------

[](#basic-use)

#### Select

[](#select)

```
$vane->select('*');
$vane->from('planet');
$rows = $vane->rows();
```

#### Insert

[](#insert)

```
$vane->from('planet');
$vane->save($planets);
```

#### Update

[](#update)

```
$vane->from('planet');
$vane->where('temperature', '>', 0);
$vane->save(['star' => 'Sun']);
```

#### Delete

[](#delete)

```
$vane->from('planet');
$vane->where('temperature', '>', 0);
$vane->delete();
```

#### Truncate

[](#truncate)

```
$vane->from('planet');
$vane->truncate();
```

Advanced use
------------

[](#advanced-use)

Select elements based on whether a given value is contained in a property of type array:

```
$vane->select('*');
$vane->from('planet');
$vane->contains('atmosphere', 'methane');
$rows = $vane->rows();
```

Select elements based on whether a given value is not contained in a property of type array:

```
$vane->select('*');
$vane->from('planet');
$vane->contains('atmosphere', 'methane', false);
$rows = $vane->rows();
```

Select elements based on whether a given property exists:

```
$vane->select('*');
$vane->from('planet');
$vane->exists('discoverer');
$rows = $vane->rows();
```

Select elements based on whether a given property does not exist:

```
$vane->select('*');
$vane->from('planet');
$vane->exists('discoverer', false);
$rows = $vane->rows();
```

Select elements that have more than x elements in an array property:

```
$vane->select('*');
$vane->from('planet');
$vane->counter('atmosphere', '>', 3);
$rows = $vane->rows();
```

Select a single item based on its identifier:

```
$vane->select('*');
$vane->from('planet');
$row = $vane->id('');
```

The select statement can also accept individual properties:

```
$vane->select('name', 'distance');
$vane->from('planet');
$rows = $vane->rows();
```

nested properties can be used via dot notation:

```
$vane->select('discoverer.firstname');
$vane->from('planet');
$vane->where('discoverer.nationality', '=', 'Italian');
$rows = $vane->rows();
```

Sugar syntax
------------

[](#sugar-syntax)

In both the counter method and the where method, you can pass as few as two parameters, the property name and the value to compare, thus suppressing the condition symbol. In this case it means that the condition operator is the equal sign (=)

```
$vane->where('name', 'mercury');
```

is equivalent to:

```
$vane->where('name', '=', 'mercury');
```

The same is true for the counter method:

```
$vane->counter('atmosphere', 3);
```

is equivalent to:

```
$vane->counter('atmosphere', '=', 3);
```

⭐ **If you liked what I did, if it was useful to you or if it served as a starting point for something more magical let me know with a star** 💚

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1127d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/16152fdb63dd19f8b6e28c50cbc438cb275c14231b5c545015710a580362901f?d=identicon)[JaxonRailey](/maintainers/JaxonRailey)

---

Top Contributors

[![JaxonRailey](https://avatars.githubusercontent.com/u/96697458?v=4)](https://github.com/JaxonRailey "JaxonRailey (13 commits)")

### Embed Badge

![Health badge](/badges/jaxonrailey-vane/health.svg)

```
[![Health](https://phpackages.com/badges/jaxonrailey-vane/health.svg)](https://phpackages.com/packages/jaxonrailey-vane)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
