Commit ca13c37f authored by Inkhey's avatar Inkhey

add 2nodestypeview

parent 02556800
......@@ -244,9 +244,47 @@ class sqlGit(object):
''')
self.conn.commit()
def view_2nodestype():
def view_2nodestype(self):
'''View with 2 types of nodes : author,file'''
pass
c = self.conn.cursor()
c.execute('''create view nodes as
select dir || name as id ,
size as taille,
dir as dir,
"" as name,
"" as email,
"file" as type,
dir || name as label
from file
union
select name || email as id,
"" as taille,
"" as dir,
name as name,
"" as email,
"author" as type,
name as label
from author;''')
c.execute(''' create view edges as
select
lac.author_name || lac.author_mail as source,
lfc.dir || lfc.file as target,
count(distinct(c.hash)) as nb_commit,
min(c.date) as date_first_commit,
max(c.date) as date_last_commit
from
link_author_commits lac
join
commits c
on lac.commits = c.hash
join
link_file_commits lfc
on c.hash = lfc.commits
group by lac.author_name || lac.author_mail,lfc.dir || lfc.file;
''')
self.conn.commit()
def view_files():
'''View of relation between files'''
......
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