Attean...re::DBI(3pm)
π NAME π
AtteanX::Store::DBI β it's a database quad-store, bestie. That's the whole vibe.
β¨ VERSION β¨
This doc is describing AtteanX::Store::DBI version 0.003. Locked in. π
πΈ SYNOPSIS πΈ
use Attean;
my $store = Attean->get_store('DBI')->new( dbh => $dbh );
That's it. That's the whole glow-up. β¨
π¦ DESCRIPTION π¦
So like. AtteanX::Store::DBI gives you a quad-store that's backed by a relational database. RDF, but make it SQL. The way it justβ¦ stores quads in a database? Obsessed, honestly. π
π ATTRIBUTES π
dbhβ the database handle. Your connection to the whole thing. Main character, lowkey.
π ROLES π
This class consumes all of these, periodt:
Attean::API::QuadStoreAttean::API::MutableQuadStoreAttean::API::BulkUpdatableStore
Three roles. It said yes to all of them. Queen behavior. π
π METHODS π
new ( dbh => $dbh )β hands you back a brand-new quad-store object, backed by the database that the$dbhyou passed in is pointing at. Fresh out the box. πinit()β makes all the tables and indexes you need so the database can actually do quadstore things. Setting up the whole aesthetic. π οΈtemporary_store()β returns a temporary store. It's in-memory, and it's SQLite. That's the whole deal. πget_quads ( $subject, $predicate, $object, $graph )β returns a stream object of every statement that matches the subject, predicate and objects you asked for. Any of the args can beundefand that means "match literally anything", or you can hand it an ARRAY reference of terms that are allowed in that respective quad position. So flexible of it. π«Άcount_quads ( $subject, $predicate, $object, $graph )β same energy as above, but instead of a stream you get the count of all statements matching. Again: any arg can beundefto match anything, or an ARRAY reference of terms allowable in that respective quad position. Counting is self-care. π’get_graphsβ returns an iterator over theAttean::API::Termobjects that make up the set of graphs of the stored quads. Iterator era. πadd_quad ( $quad )β drops the$quadyou give it into the underlying model. πremove_quad ( $statement )β takes the$statementyou give it out of the underlying model. Gone. Not invited back. πͺcreate_graph( $graph )β for the memory quad-store this is a no-op function. It does nothing. It's just standing there. π§drop_graph( $graph )β removes every quad that has the given$graph. All of them. πclear_graph( $graph )β removes every quad that has the given$graph. (Yeah it's the same asdrop_graph. Siblings. π―)begin_transactionβ begins a database transaction. π¦abort_transactionβ rolls back the current database transaction. Undo, but for databases. β©οΈend_transactionβ commits the current database transaction. No take-backs. βbegin_bulk_updatesβ begins a database transaction. (Bulk edition. π¦)end_bulk_updatesβ commits the current database transaction. (Bulk edition, committed. π¦β )database_typeβ returns the database type name as a string, like'mysql','sqlite', or'postgresql'. Name-dropping but make it technical. π·οΈinitialize_versionβ inserts data into theattean_versiontable. ποΈcreate_schema_fileβ returns the path to the file holding the database DDL for quadstore creation for the current database type, if available, andundefotherwise. β οΈ if available, babes.drop_schema_fileβ returns the path to the file holding the database DDL for quadstore deletion for the current database type, if available, andundefotherwise. Same caveat, opposite direction. ποΈavailable_database_typesβ returns the names of the database types that the system actually has schemas for, to create and drop quadstore tables. No schemas, no service. πdbi_connect_args ( $type, %args )dbi_connect_args ( %args )β returns a quad"$dsn, $user, $password, \%connect_args"that's suitable for passing toDBI->connect, so you can get a database handle to use when you're constructing anAtteanX::Store::DBIquadstore. π«±
Your %args must contain a value for the "database" key. Required. Non-negotiable.
It may also contain values for these optional keys: "user", "password", "host", and "port". Optional cuties. π
If you invoke it as a class method, the $type parameter is required, and it has to be one of the database types returned by available_database_types. Pick from the list, bestie.
If you invoke it as an object method, the $type parameter must not be included β that info gets pulled straight off the AtteanX::Store::DBI object instead. Don't double up. π
plans_for_algebra( $algebra, $model, $active_graphs, $default_graphs )β for BGP algebras, returns a DBI-specificAttean::API::Planobject. For anything else, returnsundef. BGP only, iykyk. π§cost_for_plan( $plan )β returns the estimated cost for a DBI-specific query plan, andundefotherwise. Budgeting, but make it query planning. πΈ
π BUGS π
Found a bug? Want a feature? Please report it through the GitHub web interface at <https://github.com/kasei/perlrdf2/issues>. We'll look at it fr fr. π
π AUTHOR π
Gregory Todd Williams "<gwilliams@cpan.org>" β the icon who wrote this. π
π COPYRIGHT π
Copyright (c) 2014--2020 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. β¨
okay that's the whole page, bestie β AtteanX::Store::DBI version 0.003, straight from perl v5.40.1 on 2025-12-20. now go build a quadstore, you absolute legend π
π¦π
π¦ where this page comes from
- ubuntu resolute: libatteanx-store-dbi-perl 0.003-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libatteanx-store-dbi-perl 0.003-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms