|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78606 - in sandbox/icl/libs/xplore/br1/sqlbrowser: . gen
From: afojgo_at_[hidden]
Date: 2012-05-25 05:59:36
Author: jofaber
Date: 2012-05-25 05:59:34 EDT (Fri, 25 May 2012)
New Revision: 78606
URL: http://svn.boost.org/trac/boost/changeset/78606
Log:
First presentable state of Db Generator.
Binary files modified:
sandbox/icl/libs/xplore/br1/sqlbrowser/Generatic1.db
Text files modified:
sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql | 17 ++++++++++-------
sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.cpp | 36 ++++++++++++++++++++++++++++++++++++
sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.h | 20 ++++++++++++++++----
sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro | 4 ++--
4 files changed, 64 insertions(+), 13 deletions(-)
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/Generatic1.db
==============================================================================
Binary files. No diff available.
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/TypeExtensibleDag.sql 2012-05-25 05:59:34 EDT (Fri, 25 May 2012)
@@ -397,21 +397,24 @@
left outer join IntObject as YearOfCreation on YearOfCreation.refObject = Vertex.key
group by Vertex.key
+
+
+
-- -----------------------------------------------------------------------------
-- View Track
-- create view Track as
-select -- Edge.refSourceVertex as ArtistKey,
- Vertex.key as TrkKey, TrackName.value
- , MotherAlbum.refSourceVertex as MAlbKey, Album.Key as AlbKey
- , Album.Name as AlbumName, Album.Artists as AlbumArtists
+select Vertex.key as TrackId
+, TrackName.value as Name
+, MotherAlbum.key as AlbId, AlbumName.value as Album, AlbumYear.value as AlbYr
from Vertex
inner join VarCharObject as TrackName on TrackName.refObject = Vertex.key
and TrackName.refAttribute = 1
- and Vertex.refObjectType = 3
+ and Vertex.refObjectType = 23 -- 23: Recording (aka. Track)
left outer join Edge as MotherAlbum on MotherAlbum.refTargetVertex = Vertex.key
and MotherAlbum.refEdgeType = 5 -- 5: Album contains Recording
- left outer join Album on MotherAlbum.refSourceVertex = Album.Key
-
+ left outer join VarCharObject as AlbumName on AlbumName.refObject = MotherAlbum.refSourceVertex
+ left outer join IntObject as AlbumYear on AlbumYear.refObject = MotherAlbum.refSourceVertex
+
-- -----------------------------------------------------------------------------
-- Select from Edges
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.cpp
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.cpp (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.cpp 2012-05-25 05:59:34 EDT (Fri, 25 May 2012)
@@ -19,6 +19,13 @@
m_iTitles = 100;
m_iAlbums = 50;
m_iRecordings = 200;
+
+ /*
+ m_iArtists = 5000;
+ m_iTitles = 50000;
+ m_iAlbums = 25000;
+ m_iRecordings = 100000;
+ */
}
void DbGenerator::clear()
@@ -156,10 +163,23 @@
void DbGenerator::generateAttributes()
{
+ //---- VarChar -------------------------------------------------------------
exec("insert into Attribute values (1, 1, 'Name')" );
exec("insert into Attribute values (2, 1, 'Duration')");
+ exec("insert into Attribute values (3, 1, 'Genre')" );
+ exec("insert into Attribute values (4, 1, 'Label')" );
+ exec("insert into Attribute values (5, 1, 'Comment')" );
+
+ exec("insert into Attribute values (6, 1, 'Remixer')" );
+ exec("insert into Attribute values (7, 1, 'Producer')");
+ exec("insert into Attribute values (8, 1, 'Composer')");
+
+ //---- Integer -------------------------------------------------------------
exec("insert into Attribute values (31, 2, 'Year')" );
exec("insert into Attribute values (32, 2, 'Pos')" );
+ exec("insert into Attribute values (33, 2, 'BPM')" );
+ exec("insert into Attribute values (34, 2, 'Playcount')");
+ exec("insert into Attribute values (35, 2, 'Rating')");
}
@@ -256,6 +276,22 @@
//JODO make name from album & title
insertVarCharObject(aKey, A_Name, makeRecordingName(aAlbumKey, aTitleKey));
insertIntObject(aKey, A_Year, gen::IntGenerator(1960, 2012)());
+ //--------------------------------------------------------------------------
+ insertVarCharObject(aKey, A_Duration, "03:45");
+ insertVarCharObject(aKey, A_Genre, m_aSomeName("G_"));
+ insertVarCharObject(aKey, A_Label, m_aSomeName("L_"));
+ insertVarCharObject(aKey, A_Comment, m_aSomeName("Comment_"));
+
+ insertVarCharObject(aKey, A_Remixer, m_aSomeName("Remx_"));
+ insertVarCharObject(aKey, A_Producer, m_aSomeName("Prod_"));
+ insertVarCharObject(aKey, A_Composer, m_aSomeName("Comp_"));
+
+ insertIntObject(aKey, A_Position, gen::IntGenerator(1, 10)());
+ insertIntObject(aKey, A_BPM, gen::IntGenerator(50, 200)());
+ insertIntObject(aKey, A_Playcount, gen::IntGenerator(0, 200)());
+ insertIntObject(aKey, A_Rating, gen::IntGenerator(1, 5)());
+ insertIntObject(aKey, A_Added, gen::IntGenerator(100, 500)());
+ //--------------------------------------------------------------------------
return aKey;
}
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/gen/DbGenerator.h 2012-05-25 05:59:34 EDT (Fri, 25 May 2012)
@@ -51,10 +51,22 @@
};
enum {
- A_Name = 1
- , A_Duration = 2
- , A_Year = 31
- , A_Position = 32
+ A_Name = 1
+ , A_Duration = 2
+ , A_Genre = 3
+ , A_Label = 4
+ , A_Comment = 5
+
+ , A_Remixer = 6
+ , A_Producer = 7
+ , A_Composer = 8
+
+ , A_Year = 31
+ , A_Position = 32
+ , A_BPM = 33
+ , A_Playcount = 34
+ , A_Rating = 35
+ , A_Added = 36
};
enum {
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro 2012-05-25 05:59:34 EDT (Fri, 25 May 2012)
@@ -3,8 +3,8 @@
QT += sql
-INCLUDEPATH += /cygwin/home/jofa/dev/boost/branches/release
-#INCLUDEPATH += C:\NIBuild\3rdparty\boost-1.48.0
+#INCLUDEPATH += /cygwin/home/jofa/dev/boost/branches/release
+INCLUDEPATH += C:\NIBuild\3rdparty\boost-1.48.0
HEADERS = browser.h connectionwidget.h qsqlconnectiondialog.h \
exttableview.h \
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk