World: r3wp
[SQLite] C library embeddable DB .
older newer | first last |
Henrik 21-Jan-2010 [1093] | you can wrap the fields in a panel and use: set-face my-panel [db/:counter/2 db/:counter/3 ...] |
Robert 21-Jan-2010 [1094] | And, I have abstracted this idea in that a function walks over the set-words of an object and use these as columnnames. |
Henrik 21-Jan-2010 [1095x2] | in the VID extension kit you can say: set-face my-panel object object: get-face my-panel |
hmm... actually not really. forget that. I'm distracted. :-) | |
amacleod 21-Jan-2010 [1097] | Henrik, What's the latest versionof Ext kit? |
Henrik 21-Jan-2010 [1098] | 003. Unfortunately, it's moving too slow. I won't have any time to do updates for a while. |
Gregg 21-Jan-2010 [1099] | There is no standard I know of for mapping data to faces. A number of us have rolled our own systems over time, each with our own critieria and design aesthetic. As a simple starting point, consider setting up declarative mappings and driving a data-exchange loop. e.g. face-field-map: [ lname 2 fname 3 spouse 4 email 5 hphone 6 cphone 7 addr 8 city 9 state 10 zip 11 ] foreach [face-name field-index] face-field-map [ set-face get face-name pick db/:counter field-index ] |
jrichards 21-Jan-2010 [1100] | Thanks Gregg, as a newbie I was just trying to get an idea as to how others are handling this. I was thinking that there had to be a more concise method than the one I was using. |
Janko 18-Apr-2010 [1101x3] | -- You can use rebsqlite with core on windows (it allows dll inclusion) but how can you use it on linux? It seems linux rebol doesn't allow .so . I used rebpro which does this but now I also need to send an email from it and it gives me some strange message "Set-Net not provided."? Maybe I am doing something wrong/using the wrong tools... how can you use rebol with sqlite on linux?? |
(I have bought SDK btw .. but I don't know for what reason I bought it for windows(?!?!!), where I really don't need it so it doesn't help me at all in this situation) | |
hm.. is license transferable between linux/windows or some discount for another if you bought the first one? | |
Pekr 18-Apr-2010 [1104] | I am not sure license is transferrable, but license is just one file - try to copy it to linux machine. If it is legally OK, I don't know. But - I would probably ask Carl ... |
Maxim 18-Apr-2010 [1105] | IIRC, the latest SDK purchase gives you a license for every platform. might be worth upgrading (50$ is like not going to restaurant once... your wife/girlfriend will get over it ;-). |
Janko 18-Apr-2010 [1106] | I don't see it mentioned anywhere that this license / upgrade is multiplatform. The select box is the same as before where you choose the platform. I have no problem giving $50, but I am running on fumes here and $350 shows on my account, especially if I am don't need it really, because rebol core/view on windows work with rebol sqlite and I haven't seen anywhere that linux version has different logic. |
Maxim 18-Apr-2010 [1107] | yeah the website seems to indicate that we still need to buy each license separately. |
Janko 18-Apr-2010 [1108x2] | (I will gladly buy all rebol versions in existence when I can afford it) |
hm .. maybe access to dll/so is available only to view and not core. and because I use core (cmdline) on linux server it doesn't work | |
Maxim 18-Apr-2010 [1110] | rebpro is the one with dll. |
BrianH 18-Apr-2010 [1111] | Yeah, for now /Core doesn't have /Library. /Pro does, and can be encapped to resemble /Core with /Library; that is the only difference between /Pro and /Base. |
Janko 18-Apr-2010 [1112] | /View (free) also supports dll-s for very long time now |
Maxim 18-Apr-2010 [1113] | I really wish Carl would release the various reb*** builds outside of the SDK. they are very usefull as-is, even when not encapping scripts. |
BrianH 18-Apr-2010 [1114x3] | Yes, /View/Pro is now free and called /View. |
I actually bought /View/Pro back before it was free. | |
Maxim, the SDK is useful as-is too. That's why people pay for it. Don't knock the business model :) | |
Janko 18-Apr-2010 [1117x2] | aha, I tried is. it's not that windows supports dll-s and linux not but the view does and core doesn't. I guess I am gonna have to buy the linux sdk also. |
Brian, do you know what's the trick with "Set-Net not provided." in rebpro? | |
BrianH 18-Apr-2010 [1119] | I would guess that you have to include %prot-setnet.r in your script to use it. |
Janko 18-Apr-2010 [1120] | Brian: huh.. I see now I made typo when making file that do-es all mezz and proto files .. if I load it correctly set-net works! |
BrianH 18-Apr-2010 [1121] | Yup. And (on Windows at least) set-net is by default that "Set-Net not provided." function in /Base, /Pro and /Face, on purpose. The only reason that function is in the encap bases at all is because it is called in the startup code of /Face. |
Janko 18-Apr-2010 [1122] | thanks, I have one problem less now |
florin 2-Oct-2010 [1123] | Rebol and DSL's are hand and glove. Is there a SQL dsl anywhere? I found the driver from dobeash. Is there more? |
ChristianE 2-Oct-2010 [1124] | I'm not sure if that would be worth the effort, SQL can get fairly complex and if a REBOL SQL wouldn't implement everything (even specific databases prorietary extensions to SQL) that wouldn't be a noticable gain in simplicity. Wouldn't it still just be SQL written in REBOL's syntax? Actually, I think it's more like SQL already is a perfect example of a DSL on it's own (not implying here that SQL is perfect, just the example is). |
florin 2-Oct-2010 [1125x2] | I found this: http://www.rebol.org/documentation.r?script=sql-protocol.r |
And this is a snippet: do %sql-protocol.r db: open sql:my-db insert db { SELECT * FROM a, b WHERE a.c2 = b.c1 AND a.c1 = 1 ORDER BY 1, 2 DESC } foreach item copy db [probe item] close db Isn't this better than working with strings? | |
Ladislav 2-Oct-2010 [1127] | see also http://www.rebol.net/wiki/R2_projects |
ddharing 5-Nov-2010 [1128] | I have a REBOL/View application where I am doing SQL calls in a face timer to update the face. I am having an intermittent issue where the result of one face's SQL statement is showing up in another face. I am doing a copy of the result set based on what I've read in the Dobeash docs. It appears that the face timer code blocks and another timer event occurs and does a SQL call. Does anyone know how to make a timer function finish before another one triggers? I may also be using the driver incorrectly. |
GrahamC 5-Nov-2010 [1129] | can't you queue your sql queries? |
ddharing 5-Nov-2010 [1130] | For now, I've wrapped the SQL calls with "busy" flag logic and that seems to work -- but it is a hack. The fact that a SQL function call inside a face timer event returns a dataset from a different face is shocking to me. REBOL should handle this properly in the background. My mental model of single-threaded event handling (rooted in classic VB) leads me to believe that this is a bug. In addition to returning data to the wrong face, the SQLite shared object will also sometimes seg fault. It working fine now, though, with my busy flag hack. |
Sunanda 5-Nov-2010 [1131] | It does sound like a bug. Best way to get it looked at / resolved is to add a bug report to RAMBO (the R2 bug database): http://www.rebol.net/cgi-bin/rambo.r |
ddharing 5-Nov-2010 [1132] | OK. Thanks. |
GrahamC 5-Nov-2010 [1133x2] | I'm not clear what the issue is .. do you have different sql queries being triggered by timer events on different faces? |
Anyway I use asynchronous database queries and have never seen this issue. | |
ddharing 7-Nov-2010 [1135x3] | Graham, yes, I am triggering queries using timer events, and the sql results are being returned to the wrong calling function. My classic VB way of doing things doesn't work. How exactly are you doing your queries? Putting them in a queue to be serviced by a single function? For me that would also require including the face, so it can be updated when the sql call completes. |
Here is Gabriele's response to my bug report (RAMBO ticket # 4411) This is not really a REBOL bug. The SQLite driver is doing a WAIT 1 in the DO-STEP function; calling WAIT inside an event handler (such as a face's timer event) is not really supported by REBOL and should be avoided. If you can't avoid it, you must be prepared to handle other events happening during that WAIT call, and you need to be very careful with blocking requesters (SHOW-POPUP, INFORM etc.) as they're likely to mess things up (they call WAIT as well). My suggestions are: 1) File a bug report with the SQLite driver. There needs to be a way to avoid the WAIT, though I guess this is going to be complicated in R2. 2) Disable other events while you're using the SQLite driver, eg. clear SYSTEM/PORTS/WAIT-LIST and restore it afterwards. 3) Use a "global" flag like you're doing. -Gabriele | |
Gabriele, when you say "clear SYSTEM/PORTS/WAIT-LIST", do you mean setting it to NONE temporarily? | |
Gregg 7-Nov-2010 [1138] | I think he means storing the contents in another var temporarily, using CLEAR on it, then restoring the original contents using INSERT or APPEND. |
GrahamC 7-Nov-2010 [1139] | Yes, as I use callbacks on all my sql calls |
Gabriele 7-Nov-2010 [1140x2] | As Gregg said, it still needs to be a block! otherwise WAIT will complain (IIRC). |
most likely, you'll only have the event port in the wait list, so it's just a matter of removing it and adding it back later. I can't guarantee this works 100% because I haven't tested it. another alternative could be: 4) don't use face timers, but rather replace do-events with something like: forever [ wait 1 do-your-sql-calls ] You'll still have other events happening while you're doing your sql calls in this case though, not sure if that can be a problem. The cleanest solution would be to change the driver so it does not wait, but I don't know SQLite so I can't say how easy that would be. | |
ddharing 7-Nov-2010 [1142] | Thanks everyone for your explanations and suggestions. |
older newer | first last |