App-Sqitch
view release on metacpan or search on metacpan
lib/App/Sqitch/Engine/exasol.pm view on Meta::CPAN
}, undef, $self->plan->project, $change_id) || return undef;
$change->{timestamp} = _dt $change->{timestamp};
unless (ref $change->{tags}) {
$change->{tags} = $change->{tags} ? [ split / / => $change->{tags} ] : [];
}
return $change;
}
sub changes_requiring_change {
my ( $self, $change ) = @_;
# Why CTE: https://forums.oracle.com/forums/thread.jspa?threadID=1005221
# NOTE: Query from DBIEngine doesn't work in Exasol:
# Error: [00444] more than one column in select list of correlated subselect
# The CTE-based query below seems to be fine, however.
return @{ $self->dbh->selectall_arrayref(q{
WITH tag AS (
SELECT tag, committed_at, project,
ROW_NUMBER() OVER (partition by project ORDER BY committed_at) AS rnk
FROM tags
)
SELECT c.change_id, c.project, c.change, t.tag AS asof_tag
FROM dependencies d
JOIN changes c ON c.change_id = d.change_id
LEFT JOIN tag t ON t.project = c.project AND t.committed_at >= c.committed_at
WHERE d.dependency_id = ?
AND (t.rnk IS NULL OR t.rnk = 1)
}, { Slice => {} }, $change->id) };
}
sub name_for_change_id {
my ( $self, $change_id ) = @_;
# Why CTE: https://forums.oracle.com/forums/thread.jspa?threadID=1005221
# NOTE: Query from DBIEngine doesn't work in Exasol:
# Error: [0A000] Feature not supported: non-equality correlations in correlated subselect
# The CTE-based query below seems to be fine, however.
return $self->dbh->selectcol_arrayref(q{
WITH tag AS (
SELECT tag, committed_at, project,
ROW_NUMBER() OVER (partition by project ORDER BY committed_at) AS rnk
FROM tags
)
SELECT change || COALESCE(t.tag, '@HEAD')
lib/App/Sqitch/Engine/oracle.pm view on Meta::CPAN
$self->_char2ts( $change->timestamp ),
$change->planner_name,
$change->planner_email,
);
return $self;
}
sub changes_requiring_change {
my ( $self, $change ) = @_;
# Why CTE: https://forums.oracle.com/forums/thread.jspa?threadID=1005221
return @{ $self->dbh->selectall_arrayref(q{
WITH tag AS (
SELECT tag, committed_at, project,
ROW_NUMBER() OVER (partition by project ORDER BY committed_at) AS rnk
FROM tags
)
SELECT c.change_id, c.project, c.change, t.tag AS asof_tag
FROM dependencies d
JOIN changes c ON c.change_id = d.change_id
LEFT JOIN tag t ON t.project = c.project AND t.committed_at >= c.committed_at
WHERE d.dependency_id = ?
AND (t.rnk IS NULL OR t.rnk = 1)
}, { Slice => {} }, $change->id) };
}
sub name_for_change_id {
my ( $self, $change_id ) = @_;
# Why CTE: https://forums.oracle.com/forums/thread.jspa?threadID=1005221
return $self->dbh->selectcol_arrayref(q{
WITH tag AS (
SELECT tag, committed_at, project,
ROW_NUMBER() OVER (partition by project ORDER BY committed_at) AS rnk
FROM tags
)
SELECT change || COALESCE(t.tag, '@HEAD')
FROM changes c
LEFT JOIN tag t ON c.project = t.project AND t.committed_at >= c.committed_at
WHERE change_id = ?
lib/App/Sqitch/Engine/vertica.pm view on Meta::CPAN
LIMIT 1$offexpr
}, undef, $project || $self->plan->project)->[0];
} catch {
return if $self->_no_table_error && !$self->initialized;
die $_;
};
}
sub changes_requiring_change {
my ( $self, $change ) = @_;
# Why CTE: https://forums.oracle.com/forums/thread.jspa?threadID=1005221
return @{ $self->dbh->selectall_arrayref(q{
WITH tag AS (
SELECT tag, committed_at, project,
ROW_NUMBER() OVER (partition by project ORDER BY committed_at) AS rnk
FROM tags
)
SELECT c.change_id, c.project, c.change, t.tag AS asof_tag
FROM dependencies d
JOIN changes c ON c.change_id = d.change_id
LEFT JOIN tag t ON t.project = c.project AND t.committed_at >= c.committed_at
WHERE d.dependency_id = ?
AND (t.rnk IS NULL OR t.rnk = 1)
}, { Slice => {} }, $change->id) };
}
sub name_for_change_id {
my ( $self, $change_id ) = @_;
# Why CTE: https://forums.oracle.com/forums/thread.jspa?threadID=1005221
return $self->dbh->selectcol_arrayref(q{
WITH tag AS (
SELECT tag, committed_at, project,
ROW_NUMBER() OVER (partition by project ORDER BY committed_at) AS rnk
FROM tags
)
SELECT change || COALESCE(t.tag, '@HEAD')
FROM changes c
LEFT JOIN tag t ON c.project = t.project AND t.committed_at >= c.committed_at
WHERE change_id = ?
lib/sqitchtutorial-oracle.pod view on Meta::CPAN
Then restart the VM. You should then be able to connect from your host with:
sqlplus sys/oracle@localhost/ORCL as sysdba
If this fails with either of these errors:
ORA-01017: invalid username/password; logon denied ORA-21561: OID
generation failed
Make sure that your computer's hostname is on the localhost line of F</etc/hosts>
(L<reference|https://sourceforge.net/p/tora/discussion/52737/thread/f68b89ad/>):
> hostname
stickywicket
> grep 127 /etc/hosts
127.0.0.1 localhost stickywicket
=item *
Give user C<scott> the access it needs:
# Then restart the VM. You should then be able to connect from your host with:
#
# sqlplus sys/oracle@localhost/ORCL as sysdba
#
# If this fails with either of these errors:
#
# ORA-01017: invalid username/password; logon denied ORA-21561: OID
# generation failed
#
# Make sure that your computer's hostname is on the localhost line of /etc/hosts
# (https://sourceforge.net/p/tora/discussion/52737/thread/f68b89ad/):
#
# > hostname
# stickywicket
# > grep 127 /etc/hosts
# 127.0.0.1 localhost stickywicket
#
# Once connected, execute this SQL to create the user and give it access:
#
# CREATE USER sqitchtest IDENTIFIED BY oracle;
# GRANT ALL PRIVILEGES TO sqitchtest;
( run in 1.307 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )