sql

Kreuzuebersetzer, Diskussion über Änderungen im Tuxbox-CDK und Tuxbox-CVS
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

[quote="fergy"but please put Your patch in this[/quote]
I do not have CVS write access.

The code you showed goes to cdk/make/database.mk (a new file),
just check my patch file, everything is in there.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Umm, ok, but what is with this than?

Code: Alles auswählen

+if WITH_SQLITE
+ $(INSTALL) $(targetprefix)/bin/sqlite3 $(flashprefix)/root/bin
+endif
....

Code: Alles auswählen

+if ENABLE_SQLITE
+ $(INSTALL) $(targetprefix)/bin/sqlite3 $(flashprefix)/root/bin
+endif
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

fergy hat geschrieben:Umm, ok, but what is with this than?
I replaced it with this code:

Code: Alles auswählen

if TARGETRULESET_FLASH
flash-sqlite: $(flashprefix)/root/bin/sqlite3

$(flashprefix)/root/bin/sqlite3: @DEPENDS_sqlite@ | $(flashprefix)/root
   @PREPARE_sqlite@
[...]
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

rhabarber1848 hat geschrieben:
fergy hat geschrieben:Umm, ok, but what is with this than?
I replaced it with this code:

Code: Alles auswählen

if TARGETRULESET_FLASH
flash-sqlite: $(flashprefix)/root/bin/sqlite3

$(flashprefix)/root/bin/sqlite3: @DEPENDS_sqlite@ | $(flashprefix)/root
   @PREPARE_sqlite@
[...]
Erm, commited to HEAD. :wink:
PS, I am working on Enigma epg-sql atm.... well, no much sources outside as one team don't wanna publish patch, but due to a *N*I*T*R*O* source, I try to handle that.
C Ya, Ramon
Cheers
Tommy
Tuxboxer
Tuxboxer
Beiträge: 4332
Registriert: Dienstag 7. Mai 2002, 17:04

Re: sql

Beitrag von Tommy »

is this sql construction maybe useful / faster as to work with and parse XML? Could it make sense to use it for (instead of) satelites and bouquets XML too?
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Tommy hat geschrieben:is this sql construction maybe useful / faster as to work with and parse XML? Could it make sense to use it for (instead of) satelites and bouquets XML too?
As I see in *N*I*T*R*O* sources, @chopper was use it for epg and enigma settings storage.
I don't see reason why it cannot be used for anything else?! It's simply sql, so as We use it in Linux distributions, We can use it in Enigma ( maybe Neutrino.... @seife?! ) for storage of anything!
If.... ( I will name it with marks ) *P*L*i* can use it for EPG.... and don't wanna publish patch, so We must to handle patch by ourself... :gruebel:
Shall We...... ?! :wink:
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Tommy hat geschrieben:is this sql construction maybe useful / faster as to work with and parse XML? Could it make sense to use it for (instead of) satelites and bouquets XML too?

Erm, yup, satellites storage? No problem.... :

Code: Alles auswählen

CREATE TABLE orbitalSats (

	satID		INT PRIMARY KEY,

	satName		TEXT,

	satFlags	INT,

	satPos		INT

);




CREATE UNIQUE INDEX idx_id ON orbitalSats(satID);



/* Put satellite inserts here from satellites.xml */

INSERT INTO orbitalSats (satID,satName,satFlags,satPos) VALUES (01,"119.0 W EchoStar 7",1,-1190);

INSERT INTO orbitalSats (satID,satName,satFlags,satPos) VALUES (02,"110.0 W EchoStar 6",1,-1100);

INSERT INTO orbitalSats (satID,satName,satFlags,satPos) VALUES (03,"105.0 W AMC 2",1,-1050);

INSERT INTO orbitalSats (satID,satName,satFlags,satPos) VALUES (04,"97.0 W Telstar 5",1,-970);

INSERT INTO orbitalSats (satID,satName,satFlags,satPos) VALUES (05,"91.0 W Nimiq 1",1,-910);

INSERT INTO orbitalSats (satID,satName,satFlags,satPos) VALUES (06,"82.0 W Nimiq 2",1,-820);

INSERT INTO orbitalSats (satID,satName,satFlags,satPos) VALUES (07,"61.5 W EchoStar 3",1,-615);



CREATE TABLE transponders (

	ID		INT,

	satID		INT,

	frequency	INT,

	symbol_rate	INT,

	polarization	INT,

	fec		int,

);



CREATE UNIQUE INDEX idx_id on transponders(ID,satID);



INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (100,01,12224000,20000000,1,0);

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (101,01,12239000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (102,01,12253000,20000000,1,0);

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (103,01,12268000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (104,01,12282000,20000000,1,0);

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (105,01,12297000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (106,01,12311000,20000000,1,0);

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (107,01,12326000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (108,01,12341000,20000000,1,0);

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (109,01,12355000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (110,01,12370000,20000000,1,0);

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (111,01,12384000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (112,01,12399000,20000000,1,0);

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (113,01,12414000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (114,01,12428000,20000000,1,0);	

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (115,01,12443000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (116,01,12457000,20000000,1,0);	

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (117,01,12472000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (118,01,12486000,20000000,1,0);	

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (119,01,12501000,20000000,0,0);		

INSERT INTO transponders (ID,satID,frequency,symbol_rate,polarization,fec) VALUES (120,01,12516000,20000000,1,0);
configuration? No problem:

Code: Alles auswählen

/* Enigma Configuration Table */
CREATE TABLE EnigmaConfig (
	id INT,
	key TEXT,
	value TEXT
);

CREATE UNIQUE INDEX idx_key ON EnigmaConfig(key);

INSERT INTO "EnigmaConfig" VALUES(1, '/ezap/osd/simpleMainMenu', '0');
INSERT INTO "EnigmaConfig" VALUES(1, '/ezap/osd/alpha', '255');
INSERT INTO "EnigmaConfig" VALUES(1, '/ezap/osd/gamma', '128');
INSERT INTO "EnigmaConfig" VALUES(1, '/ezap/osd/brightness', '128');
INSERT INTO "EnigmaConfig" VALUES(1, '/ezap/lcd/brightness', '130');
INSERT INTO "EnigmaConfig" VALUES(1, '/ezap/lcd/contrast', '32');
INSERT INTO "EnigmaConfig" VALUES(1, '/ezap/lcd/inverted', '0');
INSERT INTO "EnigmaConfig" VALUES(1, '/elitedvb/video/tvsystem', '2');
INSERT INTO "EnigmaConfig" VALUES(1, '/elitedvb/language', 'C');
INSERT INTO "EnigmaConfig" VALUES(1, '/elitedvb/extra/autobouquetchange', '1');
INSERT INTO "EnigmaConfig" VALUES(1, '/elitedvb/extra/hideerror', '1');
INSERT INTO "EnigmaConfig" VALUES(1, '/elitedvb/extra/clockdisplay', '1');
sql is pretty simple to handle, We just need Enigma handle.. I'll look into it and can ( will ) do few things very soon.
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

fergy hat geschrieben:I don't see reason why it cannot be used for anything else?!
Do you have Dbox2 hardware also in mind when thinking about SQL?
How does SQL perform on the 8MB flash of the Dbox2 or does it
need an external storage, like HDD or NFS?

Please make all your SQL code optional in a sense that all current
code will still function like it does now.
Coronas
Developer
Beiträge: 196
Registriert: Dienstag 16. Oktober 2001, 00:00

Re: sql

Beitrag von Coronas »

rhabarber1848 hat geschrieben:Please make all your SQL code optional in a sense that all current
code will still function like it does now.
+1
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

rhabarber1848 hat geschrieben:
fergy hat geschrieben:I don't see reason why it cannot be used for anything else?!
Do you have Dbox2 hardware also in mind when thinking about SQL?
How does SQL perform on the 8MB flash of the Dbox2 or does it
need an external storage, like HDD or NFS?

Please make all your SQL code optional in a sense that all current
code will still function like it does now.
No, I don't have Dbox2 :(
rhabarber1848 hat geschrieben:How does SQL perform on the 8MB flash
Well, how do You thing that chopper was handle that before three years? By trick? Nah, contra question, how was sql perform on old Dreambox'es?
If I have 8mb on place, how do You think that I thinking?! To improve something maybe, and that that work on small storage?!
Forget, as sql storage was long time ago builded for db, but noone was have interest to handle it, so I talk with Myself ( as You was talk with Yourself ;) )
sql need external storage ( from My reading ) only for epg icons.... well, not big deal, but that is just My opinion.
rhabarber1848 hat geschrieben:Do you have Dbox2 hardware also in mind when thinking about SQL?
Yes, I have as db7000 have also shit of memory as dbox2, so, as I have atm only 7000'er and other two boxes, but 7000 is main machine for everything, I have in mind 8mb problem.
In other way, if someone was handle this few years ago, I will put question to all: why was everybody move this question on side through 3 years?
sql is pretty smarter way to handle settings, epg-storage, ... lot's of things, ... anyway, I will remove that option if You don't like it.
In contra question, do You have Dreambox?
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Coronas hat geschrieben:
rhabarber1848 hat geschrieben:Please make all your SQL code optional in a sense that all current
code will still function like it does now.
+1
???
How will I do that, except to remove it from cvs?
"Optional" is -

Code: Alles auswählen

-enable-sqlite
!!! What ever more is optional here?
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

fergy hat geschrieben:how do You thing that chopper was handle that before three years?
I don et know, I own a Dbox2 for about a year now and started coding for Tuxbox
last autumn, so I am hearing about chopper for the first time.
fergy hat geschrieben:I have in mind 8mb problem.
Fine.
fergy hat geschrieben:why was everybody move this question on side through 3 years?
I don et know but if you think your SQL code will work fine even on a
Dbox2 with its slow CPU then it should not be of any interest to us
what happened years ago.
fergy hat geschrieben:anyway, I will remove that option if You don't like it.
I never said I dislike SQL stuff in the Tuxbox project, the opposite is true.
I just wanted to emphasize that the optional character of your SQL code
is important to me because personally I do not need it. I do not own a
satellite dish, instead I am hooked up to the local cable provider, so my
station list, EPG and so on are not that big ;)
fergy hat geschrieben:do You have Dreambox?
No.
fergy hat geschrieben:How will I do that, except to remove it from cvs?
"Optional" is -

Code: Alles auswählen

-enable-sqlite
!!! What ever more is optional here?
Everything is fine with that, the old code stays and the new functions
are activated only with --enable-sqlite, thats perfect!
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

OK.
Thank You for reply, and sorry if I was make mess in newmake stuff.
Sorry again. :dash:
Cheers until I fix something better. :oops:
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

Urgent update for sqlite patch, to be committed to CVS asap.
You broke cdk/Makefile because of bad tab chars used in cdk/make/,
also you forgot a small patch in cdk/make/reduce-libs.mk.

This diff fixes all of this: sqlite.diff
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

Code: Alles auswählen

if ENABLE_SQLITE
      -lsqlite3
endif
in apps/tuxbox/enigma/src/Makefile.am will not work due
to missing backspace, which can not be added here either.
It might even render apps/tuxbox/enigma/src/Makefile.am
useless, but I did not test that.
A backspace inside if-endif does not work in makefiles.

Attached you will find an untested patch which uses a
different way of providing the library to be linked:
sqlite2.diff
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Hope that now is ok with head and that everything is on place.
in apps/tuxbox/enigma/src/Makefile.am will not work due
to missing backspace, which can not be added here either.
It might even render apps/tuxbox/enigma/src/Makefile.am
useless, but I did not test that.
A backspace inside if-endif does not work in makefiles.
Reverted
Attached you will find an untested patch which uses a
different way of providing the library to be linked
Will try this, thank You very much.
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

CVS HEAD should now work again, thanks for your fast response.

Yet another update for sqlite2.diff sqlite2.diff to bring Enigma to life.
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

rhabarber1848 hat geschrieben:Yet another update for sqlite2.diff sqlite2.diff to bring Enigma to life.
Patch looks good, it even works with uClibc.
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Commited.
Hope that this time will not broke anything!
@rhabarber1848
Thank You very, very much for this patch!
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Umm, Dreambox branch is little different of head, must to remake this patch for it.
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

fergy hat geschrieben:Umm, Dreambox branch is little different of head, must to remake this patch for it.
That might certainly be the case, but as I do not have a dreambox I can
not help you with this, sorry. But I think willingness exists to merge HEAD
and dreambox branch some day, can you help us with this?
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

rhabarber1848 hat geschrieben:
fergy hat geschrieben:Umm, Dreambox branch is little different of head, must to remake this patch for it.
That might certainly be the case, but as I do not have a dreambox I can
not help you with this, sorry. But I think willingness exists to merge HEAD
and dreambox branch some day, can you help us with this?
Well, not too much different. It's old style school :wink:
Sure I can! Shout what You need!
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

Afaics you did not commit the complete patch I wrote, in this state
CVS HEAD is incomplete in regard of Enigmas sqlite support.
Could you please commit the missing stuff?
fergy
Developer
Beiträge: 93
Registriert: Dienstag 13. September 2005, 15:30

Re: sql

Beitrag von fergy »

Yes, I see.... was missed enigma folder, sorry. :dash:
Is now complete?
rhabarber1848
CDK-Experte
Beiträge: 4335
Registriert: Donnerstag 3. April 2008, 14:05

Re: sql

Beitrag von rhabarber1848 »

fergy hat geschrieben:Is now complete?
patch -p0 -E -i sqlite2.diff -R

applies cleanly now so I think everything was committed.

Please note that Enigma now has its own check for Sqlite
which is done only when Enigma configure was called with
--enable-sqlite:

Code: Alles auswählen

TUXBOX_APPS_LIB_PKGCONFIG(SQLITE,sqlite3)
This was done because I think some people use the Enigma
directories outside the Tuxbox CDK, therefore circumventing
the Tuxbox CDK dependency management.