Skip to content

CalderaWP/data-source

Repository files navigation

Caldera Data Source

This package provides a layer between the source of data and consumption. The idea is that if the database and other sources of data have the same interface, it will not matter what database -- or API -- the data comes from.

👀🌋 This Is A Module Of The Caldera Framework

Overview

This is used in the forms package for the database, but not for the REST API, which is a bad smell that needs corrected.

Usage

Install

  • Add to your package:
    • composer require calderawp/http
  • Install for development:

Examples

use calderawp\DB\Factory;
use calderawp\interop\Attribute;
calderawp\interop\Collections\Attributes;

$tableName = 'cf_whatever';
$primaryKey = 'id';
$indexes = ['name'];

$tableSchema = $factory->tableSchema([], $tableName, $primaryKey, $indexes);

Testing

  • Run unit tests and integration tests
    • composer tests
  • Run unit tests
    • composer test:unit
  • Run integration tests
    • composer test:integration

License, Copyright, etc.

Copyright 2018+ CalderaWP LLC and licensed under the terms of the GNU GPL license. Please share with your neighbor.

About

[READ-ONLY] Caldera framework data source package.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages