Package CHEM :: Package DB :: Package rdb :: Module database :: Class SourcererDatabase
[hide private]
[frames] | no frames]

Class SourcererDatabase



Database --+    
           |    
  PQDatabase --+
               |
              SourcererDatabase

Class which handles the low-level DB API for updating categories

Instance Methods [hide private]
 
__init__(self, host, database, username, password)
constructor
 
insertCategory(self, categoryName)
Insert a category into the database
 
insertCategories(self, categoryList=[])
Inserts a list of categories into the database
 
insertProject(self, projectName, projectVersion, projectUri, sourceInCategory, duplicateCategory)
Updates the repo_checkout table
 
getCategoryName(self, categoryID)
Get category name given an ID
 
getCategoryID(self, categoryName)
Get category ID given category name
 
getProjectName(self, projectID)
Get project name given project ID
 
getProjectID(self, projectName)
Get project name given project ID
 
updateProjectCategoryTable(self, projectName, categoryName)
update the projectCategoryTable
 
insertProjectCategory(self, projectID, categoryID)
update the projectCategoryTable using IDs

Inherited from PQDatabase: cleanStatement, close, connect, execute, executeList, fetch, insert, select

Class Variables [hide private]
  categoryTypesTable = " repo_category_types "
  projectEntryTable = " repo_checkout "
  projectCategoryTable = " repo_in_categories "
Method Details [hide private]

__init__(self, host, database, username, password)
(Constructor)

 
constructor
Overrides: PQDatabase.__init__

insertProject(self, projectName, projectVersion, projectUri, sourceInCategory, duplicateCategory)

 

Updates the repo_checkout table

repo_uri VARCHAR(512),

checkout_date DATE DEFAULT CURRENT_TIMESTAMP,

/* name of the project in sourceforge, eg: jEdit */ storage_root VARCHAR(512) NOT NULL,

/* see === note on status === below */ state SMALLINT DEFAULT 0,

/* false, for now */ has_binary BOOLEAN DEFAULT FALSE,

/* false, for now */ has_source BOOLEAN DEFAULT FALSE,

/* the version ID that was found in sourceforge eg: 1.0 (NOT, v_1.0) */ version VARCHAR(30),

/* lookup category-id from above */ source_in_category_type_id INTEGER /* REFERENCES repo_category_types(category_type_id) */,

/* the primary category folder under which the source code resides physically */ default_category_id INTEGER /* REFERENCES repo_category_types(source_in_category_type_id) */

insertProjectCategory(self, projectID, categoryID)

 

update the projectCategoryTable using IDs

/* each category that a project belongs to is recorded here */ CREATE TABLE repo_in_categories (

repo_checkout_id INTEGER /* REFERENCES repo_checkout(repo_checkout_id) */,

category_type_id INTEGER /* REFERENCES repo_category_types(category_type_id) */