1 package SL::Auth::ColumnInformation;
6 use Scalar::Util qw(weaken);
11 my ($class, %params) = @_;
13 my $self = bless {}, $class;
15 $self->{auth} = $params{auth} || croak "Missing 'auth'";
24 return $self if $self->{info};
28 foreach my $table (qw(session session_content)) {
30 SELECT a.attname, format_type(a.atttypid, a.atttypmod) AS format_type, d.adsrc, a.attnotnull
32 LEFT JOIN pg_attrdef d ON (a.attrelid = d.adrelid) AND (a.attnum = d.adnum)
33 WHERE (a.attrelid = 'auth.${table}'::regclass)
35 AND NOT a.attisdropped
39 $self->{info}->{$table} = { selectall_as_map($::form, $self->{auth}->dbconnect, $query, 'attname', [ qw(format_type adsrc attnotnull) ]) };
47 return $self->_fetch->{info};
51 my ($self, $column, $table) = @_;
52 return $self->info->{$table || 'session_content'}->{$column};