def __init__(self, fs_table, mounts_table): fs_col = PkName('filesystem') fs_col.set_fk(fs_table) mnt_name_col = PkName('mnt_name') mnt_name_col.set_fk(mounts_table) ord_col = Num('ord') partition_column = Num('partition') columns = [fs_col, mnt_name_col, ord_col, partition_column] Table.__init__(self, 'filesystem_mounts', columns)
def template_columns(): return [ PkBigname('template'), Name('mode'), Name('owner'), Name('grp_owner'), Num('templatefile')]
def __init__(self, profiles_table, traits_table): profile_col = PkName('profile') profile_col.set_fk(profiles_table) trait_col = PkName('trait') trait_col.set_fk(traits_table) ord_col = Num('ord') Table.__init__(self, 'profile_trait', [profile_col, trait_col, ord_col])
def __init__(self, suite, traits_table): tablename = ujoin(suite, 'scripts') script_column = PkName('script') script_column.set_fk('scriptnames') sfile_column = Num('scriptfile') sfile_column.set_fk('textfiles') script_columns = [script_column, sfile_column] _TraitRelation.__init__(self, traits_table, tablename, script_columns)
def __init__(self, machines_table): machine_col = PkName('machine') machine_col.set_fk(machines_table) tablename = ujoin('machine', 'scripts') script_column = PkName('script') script_column.set_fk('scriptnames') sfile_column = Num('scriptfile') sfile_column.set_fk('textfiles') columns = [machine_col, script_column, sfile_column] Table.__init__(self, tablename, columns)
def packages_columns(): return [ PkBigname('package'), Name('priority'), Bigname('section'), Num('installedsize'), Bigname('filename'), Bigname('maintainer'), Bigname('size'), Name('md5sum'), Bigname('version'), Text('description')]
def __init__(self): suite = PkName('suite') apt_id = PkName('apt_id') order = Num('ord') name = 'suite_apt_sources' Table.__init__(self, name, [suite, apt_id, order])
from useless.sqlgen.classes import Column, Table from useless.sqlgen.defaults import Text from useless.sqlgen.defaults import PkBigname, Bigname, Name, Num dpkg_tables = ['available', 'status', 'filelist', 'md5sums', 'conffiles'] other_tables = ['current'] common_columns = [ PkBigname('package'), Name('essential'), Name('priority'), Name('section'), Num('installedsize'), Bigname('maintainer'), Name('version') ] #columns for /var/lib/dpkg/status status_columns = common_columns + [ Name('status'), Text('replaces'), Text('provides'), Text('predepends'), Text('conflicts'), Bigname('source'), Text('suggests'), Text('recommends'), Text('depends'),
def __init__(self, mounts_table): mnt_name_col = PkName('mnt_name') mnt_name_col.set_fk(mounts_table) partition_col = Num('partition') columns = [mnt_name_col, partition_col] Table.__init__(self, 'partition_mounts', columns)
def __init__(self, name, mach_types_table): mtype_col = PkName('machine_type') mtype_col.set_fk(mach_types_table) columns = [mtype_col, PkName('module'), Num('ord')] Table.__init__(self, name, columns)
def partition_columns(): return [PkName('partition'), Num('start'), Num('size'), Num('Id')]