NAME
DBIx::Class::InflateColumn::S3 - pulls files off the FS and loads them into Amazon's Simple Storage Service using NET::AMAZON::S3
SYNOPSIS
Put this in your DBIx::Class table class:
__PACKAGE__->add_columns(
# your other column definitions here
'object',
{
data_type => 's3',
size => 255,
bucket_name => $target_bucket_name
},
# and maybe some more here
);
To create a row with said S3 column:
$schema->resultset('YourClass')->create({
object => {
#the name of the key you would like
key => $key_name,
#the path to your file in the local FS
fs_path => $path,
# OPTIONAL, override the bucket defined in the table class
bucket => $bucket,
# OPTIONAL, one of the recognize ACL types from the S3 docs
acl => $ACL # defaults to private
# the accessID provided by amazon web services
access_id => $access_id,
# the secret_key provided by amazon web services
secret_key => $secret_key
},
});
Retrieving a row with the an S3 column currently only retrieves the key that was stored in S3 in the format of $bucket_name/$key.
More fun later!
TODO
Remove dies and raise exceptions
Add delete methods,
Rreturn a simple object that provides convience accessors to basic Net::Amazon::S3::Bucket methods
DESCRIPTION
InflateColumn::S3
AUTHOR
Emerson Mills
LICENSE
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.