App-Koyomi

 view release on metacpan or  search on metacpan

config/default.toml  view on Meta::CPAN

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[datasource.module]
job       = "Teng"
semaphore = "Teng"
#semaphore = "None"
 
[datasource.connector]
dsn      = "dbi:mysql:database=koyomi;host=127.0.0.1;port=3306"
#dsn      = "dbi:SQLite:tmp/koyomi.sqlite"
user     = "root"
password = ""
 
# Can override for each entity
#[datasource.connector.job]
#[datasource.connector.semaphore]
 
# === Debug Parameters
 
[debug]
#now = "2015-05-23T00:00"

lib/App/Koyomi/DataSource/Job/Teng.pm  view on Meta::CPAN

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
    args(
        my $class,
        my $ctx => 'App::Koyomi::Context',
    );
    $DATASOURCE //= sub {
        my $connector
            = $ctx->config->{datasource}{connector}{job}
            // $ctx->config->{datasource}{connector};
        my $teng = App::Koyomi::DataSource::Job::Teng::Object->new(
            connect_info => [
                $connector->{dsn}, $connector->{user}, $connector->{password},
                +{ RaiseError => 1, PrintError => 0, AutoCommit => 1 },
            ],
            schema => App::Koyomi::DataSource::Job::Teng::Schema->instance,
        );
        my %obj = (teng => $teng);
        return bless \%obj, $class;
    }->();
    return $DATASOURCE;
}

lib/App/Koyomi/DataSource/Semaphore/Teng.pm  view on Meta::CPAN

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    args(
        my $class,
        my $ctx => 'App::Koyomi::Context',
    );
    $DATASOURCE //= sub {
        my $connector
            = $ctx->config->{datasource}{connector}{semaphore}
            // $ctx->config->{datasource}{connector};
        my $teng = App::Koyomi::DataSource::Semaphore::Teng::Object->new(
            connect_info => [
                $connector->{dsn}, $connector->{user}, $connector->{password},
                +{ RaiseError => 1, PrintError => 0, AutoCommit => 1 },
            ],
            schema => App::Koyomi::DataSource::Semaphore::Teng::Schema->instance,
        );
        my %obj = (teng => $teng);
        return bless \%obj, $class;
    }->();
    return $DATASOURCE;
}



( run in 0.256 second using v1.01-cache-2.11-cpan-a5abf4f5562 )