The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Zing::Repo - Generic Store

ABSTRACT

Generic Store Abstraction

SYNOPSIS

use Zing::Repo;

my $repo = Zing::Repo->new(name => 'text');

# $repo->recv;

DESCRIPTION

This package provides a general-purpose data storage abstraction.

LIBRARIES

This package uses type constraints from:

Zing::Types

ATTRIBUTES

This package has the following attributes:

name

name(Str)

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

store

store(Store)

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

METHODS

This package implements the following methods:

drop

drop() : Int

The drop method returns truthy if the data was removed from the store.

drop example #1
# given: synopsis

$repo->drop('text-1');
search() : Search

The search method returns a Zing::Search object based on the current repo or Zing::Repo derived object.

search example #1
# given: synopsis

my $search = $repo->search;

term

term() : Str

The term method generates a term (safe string) for the datastore.

term example #1
# given: synopsis

my $term = $repo->term;

test

test() : Int

The test method returns truthy if the specific key (or datastore) exists.

test example #1
# given: synopsis

$repo->test;
test example #2
# given: synopsis

$repo->store->send($repo->term, { test => time });

$repo->test;

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