Qwiratry *::DatabaseStorage::Location

Abstract DatabaseStorage that composes blob Location I/O and Format

NAME

Qwiratry *::DatabaseStorage::Location β€” Location (+ Format) as table transport

AUTHOR

Tim Nelson - https://github.com/wayland

Blob Locations (File, HTTP) stay URI text I/O. Live tables that happen to live in a document on a Location compose that Location (and a Format) here β€” subclasses override document-to-rows / rows-to-document (Basics Β§4.2).

Default layout: $.location is a directory; each table is $location/$name.json (extension from $.file-extension).

Qwiratry::DatabaseStorage::Location::Table


class Qwiratry::DatabaseStorage::Location::Table does Qwiratry::DatabaseStorage::Table

In-process row buffer with load/flush through the parent Location driver. Mutations flush back to the Location after each successful write.

method initial-create-document(|c)

method initial-create-document(|c)
  • |c

Capture of the creating table-action arguments.
Called when a table action materialises a file that did not yet exist.
	Default: flush the (possibly empty) in-memory rows. Subclasses may require
	fields, write headers-only, etc.

method finish-open()

method finish-open()
Complete deferred open: either C<begin-lazy-load> or C<load-from-location>,
	then C<after-finish-open>.

method prefer-lazy-load(-- Bool)>

method prefer-lazy-load(--> Bool)
When C<True>, C<finish-open> calls C<begin-lazy-load> instead of
	C<load-from-location>. Default C<False> (eager load).

method begin-lazy-load()

method begin-lazy-load()
Subclass hook for deferred materialisation (e.g. seed CSV headers only).
	Default: no-op.

method after-finish-open()

method after-finish-open()
Subclass hook after lazy or eager open completes (e.g. flush altered
	schema). Default: no-op.

method load-from-location()

method load-from-location()
Read the table file via Location Source + Format Parse, then map with
	C<document-to-rows>.

method register-document-fields(Mu $parser, Mu $document)

method register-document-fields(Mu $parser, Mu $document)
  • $parser

Format Parse instance used for this load (may expose header metadata).

  • $document

Parsed document root before document-to-rows.

Optional hook after Format Parse during load: pre-register field names (e.g. CSV headers) before fill_from_aoh so FieldMode sees schema first (CD3). Default: no-op.

method flush-to-location()

method flush-to-location()
Map rows with C<rows-to-document>, Format Render, then Location Destination
	overwrite (creating the path when absent via ensure-present semantics on
	first write).

method render-document-options(-- Hash)>

method render-document-options(--> Hash)

Extra named options passed to Format Render during flush (e.g. CSV field order for header-only files). Default: none.

method clear-row-buffer()

Empty the in-memory row buffer without flushing (subclass hydrate helper).

method note-content-loaded(Bool $loaded = True)

Record whether the row buffer reflects Location content (subclass hydrate
	helper).

Qwiratry::DatabaseStorage::Location


class Qwiratry::DatabaseStorage::Location does Qwiratry::DatabaseStorage

Abstract Location-backed database driver. Subclasses must implement document-to-rows and rows-to-document.

Attributes

Str $.location
Directory (or base path) for table documents.
Str $.format
Format name for Parse/Render (default JSONdemo). The Qwiratry::Format::JSON dist’s …::Location::JSON defaults to JSON.
Str $.file-extension
Suffix for per-table files (default json).

.table-file-for

method table-file-for(Str $table-name --> Str)
Path of the document file for C<$table-name>.

.document-to-rows

Map a parsed Format document to a list of row Associatives. Subclasses
	override.

.rows-to-document

Map an in-memory row list back to a Format document root. Subclasses
	override.

.useTable

method useTable(:$table!, *%params)
Returns (or creates) per-table Location storage. Re-applies C<:action> on
	reopen (DQ14.2).

Qwiratry v0.11.0

Declarative query and data-walking architecture for Raku, with transformers, molds, walkers, I/O pipelines, and aggregate functions.

Authors

  • Tim Nelson

License

Dependencies

SlangifyImplementation::Loader:ver<0.0.9+>Glob::Grammar

Test Dependencies

Provides

  • Qwiratry
  • Qwiratry::Aggregate::AggSub
  • Qwiratry::Aggregate::AggSub::Compiler
  • Qwiratry::Aggregate::Avg
  • Qwiratry::Aggregate::BodyRewrite
  • Qwiratry::Aggregate::Count
  • Qwiratry::Aggregate::DenseRank
  • Qwiratry::Aggregate::Driver
  • Qwiratry::Aggregate::Rank
  • Qwiratry::Aggregate::Sum
  • Qwiratry::AggregateFunction
  • Qwiratry::Context
  • Qwiratry::DatabaseStorage
  • Qwiratry::DatabaseStorage::CSVdemo
  • Qwiratry::DatabaseStorage::Location
  • Qwiratry::DatabaseStorage::Location::Tree
  • Qwiratry::DatabaseStorage::Memory
  • Qwiratry::FieldMode
  • Qwiratry::Format
  • Qwiratry::Format::Base
  • Qwiratry::Format::CSVdemo
  • Qwiratry::Format::HalfHuman
  • Qwiratry::Format::JSONdemo
  • Qwiratry::Format::NDJSONdemo
  • Qwiratry::Format::Textish::RenderWalkable
  • Qwiratry::Implementation::Loader
  • Qwiratry::Location
  • Qwiratry::Location::Base
  • Qwiratry::Location::File
  • Qwiratry::Mold
  • Qwiratry::Mold::Compiler
  • Qwiratry::Mold::Registry
  • Qwiratry::Mold::Slang
  • Qwiratry::MovingFrameAggregateFunction
  • Qwiratry::Operator::Capability
  • Qwiratry::Operator::IO
  • Qwiratry::Operator::MapReduce
  • Qwiratry::Operator::Navigation
  • Qwiratry::Operator::Set
  • Qwiratry::Query::Evaluator::Eager
  • Qwiratry::Query::Evaluator::Filter
  • Qwiratry::Query::Evaluator::Join
  • Qwiratry::Query::Evaluator::Lazy
  • Qwiratry::Query::Evaluator::MapReduce
  • Qwiratry::Query::Evaluator::Navigation
  • Qwiratry::Query::Evaluator::Relational
  • Qwiratry::Query::Evaluator::Row
  • Qwiratry::Query::Evaluator::Set
  • Qwiratry::Query::Evaluator::Union
  • Qwiratry::Query::Extract
  • Qwiratry::Query::NamedJoins
  • Qwiratry::Query::RelationCommon
  • Qwiratry::Query::Runtime
  • Qwiratry::Query::Selector
  • Qwiratry::Query::Slang
  • Qwiratry::Query::Slang::Ops
  • Qwiratry::Query::Slang::Topic
  • Qwiratry::Query::Specificity
  • Qwiratry::Query::Topic
  • Qwiratry::QueryCursor
  • Qwiratry::QueryIterator
  • Qwiratry::QueryMatch
  • Qwiratry::Setup
  • Qwiratry::Singleton
  • Qwiratry::Strategy
  • Qwiratry::Strategy::ControlSignal
  • Qwiratry::Strategy::FinishResult
  • Qwiratry::Strategy::RewriteSpec
  • Qwiratry::Strategy::Traversal
  • Qwiratry::Suggest
  • Qwiratry::TaOP
  • Qwiratry::Table
  • Qwiratry::Table::Schema
  • Qwiratry::Transformer
  • Qwiratry::Transformer::Copy
  • Qwiratry::Transformer::TreeRewrite
  • Qwiratry::Tree::Navigator
  • Qwiratry::Tree::Navigator::Base
  • Qwiratry::Tree::Navigator::Filesystem
  • Qwiratry::Tree::Navigator::Match
  • Qwiratry::Tree::Navigator::RakuAST
  • Qwiratry::Tree::Replace
  • Qwiratry::Walker
  • Qwiratry::Walker::Capabilities
  • Qwiratry::Walker::Factory
  • Qwiratry::Walker::Implementation::Table
  • Qwiratry::Walker::Implementation::Tree
  • Qwiratry::Walker::Implementation::TreeWithPath
  • Qwiratry::Walker::Master
  • Qwiratry::Walker::Providing
  • TypedIterator
  • WalkCursor
  • X::Qwiratry

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite β€” the markup and publishing tools behind this site.