I wonder what's wrong with exec? I use for example:
exec { 'create_app_schema':
command => 'psql -t -A -q -c "create schema app
authorization someuser" somedb pg_admin',
path => ["${installdir}/bin", $::path],
unless => 'cmd /C psql -t -A -q -c "select nspname from
pg_catalog.pg_namespace where nspname = \'app\';" somedb pg_admin |
find "app"',
require => [Windows_env['PGPASSWORD'],
Service['postgres'], Exec['create_db']],
environment => ["PGPASSWORD=${password}"],
}
This executes the command for creating a schema, if it doesn't exist
already.
Of course, you could try to write your own resource type and
provider for db queries, but I doubt it won't buy you anything
except for a cleaner syntax and maybe platform independence.
HTH...
Dirk