steampipe plugin install francois2metz/scalingo

Table: scalingo_database_type_version

Get the version of a database.

The scalingo_database_type_version table can be used to query information about a version of a database, and you must specify which application in the where or join clause using the app_name column and the addon_id as well as the version id.

Examples

Get Database version

select
*
from
scalingo_database_type_version
where
app_name = 'caresteouvert-api'
and addon_id = 'ad-0c33a92f-000-000-000-0000000'
and id = '60a4ab3d406c12000eed29e7';

Get all Database versions of an application

with database as (
select
db.app_name,
ad.id as addon_id,
db.version_id
from
scalingo_addon ad
inner join scalingo_database db on ad.id = db.addon_id
and ad.app_name = db.app_name
where
ad.app_name = 'caresteouvert-api'
order by
db.id
)
select
*
from
database db
join scalingo_database_type_version tv on (
tv.id = db.version_id
and tv.addon_id = db.addon_id
and tv.app_name = db.app_name
);

Check if an upgrade exist for your database

select
case
when next_upgrade_id is null then false
else true
end as toupdate
from
scalingo_database_type_version
where
app_name = 'caresteouvert-api'
and addon_id = 'ad-0c33a92f-000-000-000-0000000'
and id = '60a4ab3d406c12000eed29e7';

Schema for scalingo_database_type_version

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
addon_idtext=ID of the addon.
app_nametext=Name of the app.
buildbigintBuild version number.
created_attimestamp with time zoneWhen the database type version was created.
database_type_idtextUnique ID identifying the database type (e.g. PostgreSQL, MySQL, etc).
featuresjsonbList of available features for this version.
idtext=Unique ID identifying the database type version.
majorbigintMajor version number.
minorbigintMinor version number.
next_upgrade_buildbigintNext upgrade build version number.
next_upgrade_created_attimestamp with time zoneNext upgrade creation date.
next_upgrade_database_type_idtextNext upgrade unique ID identifying the database type (e.g. PostgreSQL, MySQL, etc).
next_upgrade_idtextNext upgrade ID identifying the database type version.
next_upgrade_majorbigintNext upgrade major version number.
next_upgrade_minorbigintNext upgrade minor version number.
next_upgrade_patchbigintNext upgrade patch version number.
next_upgrade_updated_attimestamp with time zoneNext upgrade update date.
patchbigintPatch version number.
updated_attimestamp with time zoneWhen the database type version was updated.