NAME

SQL::Validator - Validate JSON-SQL

ABSTRACT

Validate JSON-SQL Schemas

SYNOPSIS

use SQL::Validator;

my $sql = SQL::Validator->new;

# my $valid = $sql->validate({
#   insert => {
#     into => {
#       table => 'users'
#     },
#     default => 1
#   }
# });

# i.e. represents (INSERT INTO "users" DEFAULT VALUES)

# die $sql->error if !$valid;

# $sql->error->report('insert');

DESCRIPTION

This package provides a json-sql data structure validation library based on the JSON-SQL json-schema standard.

ATTRIBUTES

This package has the following attributes:

schema

schema(Any)

This attribute is read-only, accepts (Any) values, and is optional.

validator

validator(InstanceOf["JSON::Validator"])

This attribute is read-only, accepts (InstanceOf["JSON::Validator"]) values, and is optional.

version

version(Str)

This attribute is read-only, accepts (Str) values, and is optional.

METHODS

This package implements the following methods:

error

error() : InstanceOf["SQL::Validator::Error"]

The error method validates the JSON-SQL schema provided.

validate

validate(HashRef $schema) : Bool

The validate method validates the JSON-SQL schema provided.

AUTHOR

Al Newkirk, awncorp@cpan.org

LICENSE

Copyright (C) 2011-2019, Al Newkirk, et al.

This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".

PROJECT

Wiki

Project

Initiatives

Milestones

Contributing

Issues