Commit fd740c26 authored by Inkhey's avatar Inkhey

view_file

parent 60ac7ee1
......@@ -287,9 +287,44 @@ class sqlGit(object):
''')
self.conn.commit()
def view_files():
def view_files(self):
'''View of relation between files'''
pass
c = self.conn.cursor()
c.execute('''create view nodes as
select dir || name as id ,
size as taille,
dir as dir,
dir || name as label
from file;''')
c.execute('''
create view edges as
select f1.file AS source , f2.file AS target,
count(distinct(f1.author)) as nbAuthors,
count(distinct(f1.author)) as weight
from
(
(select
a.author_name || a.author_mail as author,
f.dir || f.file as file
from link_file_commits f, link_author_commits a
where ( f.commits=a.commits)
)as f1
join
(select
a.author_name || a.author_mail as author,
f.dir || f.file as file
from link_file_commits f, link_author_commits a
where ( f.commits=a.commits)
)as f2
on f1.author = f2.author
and f1.file != f2.file
)
group by f1.file , f2.file;''')
self.conn.commit()
def view_authors(self):
'''View of relation between authors'''
......
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