Commit 17a82f4d authored by Inkhey's avatar Inkhey

draft of view_3nodestype

parent d4e81d68
......@@ -175,9 +175,56 @@ class sqlGit(object):
self.conn.commit()
# VIEW
def view_3nodestype():
def view_3nodestype(self):
'''View with 3 types of nodes : author,commit,file'''
pass
c = self.conn.cursor()
c.execute(
'''create view nodes as
select name as id ,
size as taille,
dir as dir,
"" as name,
"" as subject,
"" as abbrev_hash,
"" as date,
"file" as type
from file
union
select email as id,
"" as taille,
"" as dir,
name as name,
"" as subject,
"" as abbrev_hash,
"" as date,
"author" as type
from author
union
select hash as id,
"" as taille,
"" as dir,
"" as name,
subject as subject,
abbrev_hash as abbrev_hash,
date as date,
"commit" as type
from commits;
''')
c.execute(
'''create view edges as
select author_mail as source,
commits as target,
author_name,
"" as dir
from link_author_commits
union
select file as source,
commits as target,
"" as author_name,
dir
from link_file_commits;
''')
self.conn.commit()
def view_2nodestype():
'''View with 2 types of nodes : author,file'''
......@@ -239,4 +286,5 @@ if __name__ == '__main__':
#db.clean_DB()
#db.dropView()
db.create_table()
db.insert_all('.', 0)
db.insert_all('../Serpent', 0)
db.view_3nodestype()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment