Re: Euphoria MVC updates

new topic     » goto parent     » topic index » view thread      » older message » newer message
jmduro said...

If I remove both "include std/map.e" and "include mvc/mapdbg.e as map" the development server runs. It crashes later while using the script.

If I use only "include std/map.e", the server crashes instantly without any debug trace.

If I use only "include mvc/mapdbg.e as map", the serevr runs and crashes later.

I found the right syntax for sqlite3 local files to comply with url_parse(), thanks to Firefox:

constant DB_URL = "sqlite3:file:///D:/Data/Euphoria/v4/Personnel/mysql_users/users.sqlite" 

proto = sqlite3, name = "///D:/Data/Euphoria/v4/Personnel/mysql_users/users.sqlite" 

However, the script crashes instantly with no debug trace. I then added flush() to log_messages() and here are the last debug lines after this change:

2021/11/13 10:54:46 DEBUG db_connect@database.e:83 url = "sqlite3:file:///D:/Data/Euphoria/v4/Personnel/mysql_users/users.sqlite", timeout = 5000 
2021/11/13 10:54:46 DEBUG _connect@db_sqlite3.e:24 name = "\"///D:/Data/Euphoria/v4/Personnel/mysql_users/users.sqlite\"" 

Jean-Marc

Oh wow I didn't realize this is what you were doing until now. I haven't tried putting paths in URL parameter for SQLite3. The most I've done is "sqlite3://filename.db".

We'll need to update the connect handler in mvc/db_sqlite3.e to accommodate this better, as it's only pulling the name value from the parsed URL.

Does it work if you just give it a single file name without a path?

function _connect( sequence url, integer timeout ) 
 
    object proto, host, user, passwd, name, port 
    {proto,host,port,name,user,passwd,?} = url:parse( url ) 
 
    atom result, db 
 
    {result,db} = sqlite3_open( name ) 
 
    if result != SQLITE_OK then 
        return 0 
    end if 
 
    return db 
end function 
add_handler( SQLITE3, DB_CONNECT, routine_id("_connect") ) 

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu