{"action":"closed","issue":{"url":"https://api.github.com/repos/sqlitebrowser/sqlitebrowser/issues/166","labels_url":"https://api.github.com/repos/sqlitebrowser/sqlitebrowser/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/sqlitebrowser/sqlitebrowser/issues/166/comments","events_url":"https://api.github.com/repos/sqlitebrowser/sqlitebrowser/issues/166/events","html_url":"https://github.com/sqlitebrowser/sqlitebrowser/issues/166","id":50321585,"number":166,"title":"Functiones como DEFAULT de campos","user":{"login":"aMarCruz","id":6636980,"avatar_url":"https://avatars.githubusercontent.com/u/6636980?v=3","gravatar_id":"","url":"https://api.github.com/users/aMarCruz","html_url":"https://github.com/aMarCruz","followers_url":"https://api.github.com/users/aMarCruz/followers","following_url":"https://api.github.com/users/aMarCruz/following{/other_user}","gists_url":"https://api.github.com/users/aMarCruz/gists{/gist_id}","starred_url":"https://api.github.com/users/aMarCruz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aMarCruz/subscriptions","organizations_url":"https://api.github.com/users/aMarCruz/orgs","repos_url":"https://api.github.com/users/aMarCruz/repos","events_url":"https://api.github.com/users/aMarCruz/events{/privacy}","received_events_url":"https://api.github.com/users/aMarCruz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sqlitebrowser/sqlitebrowser/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/sqlitebrowser/sqlitebrowser/milestones/8","html_url":"https://github.com/sqlitebrowser/sqlitebrowser/milestones/3.7.0%20-%20Something%20Funky%20Goes%20Here","labels_url":"https://api.github.com/repos/sqlitebrowser/sqlitebrowser/milestones/8/labels","id":1086366,"number":8,"title":"3.7.0 - Something Funky Goes Here","description":"","creator":{"login":"justinclift","id":406299,"avatar_url":"https://avatars.githubusercontent.com/u/406299?v=3","gravatar_id":"","url":"https://api.github.com/users/justinclift","html_url":"https://github.com/justinclift","followers_url":"https://api.github.com/users/justinclift/followers","following_url":"https://api.github.com/users/justinclift/following{/other_user}","gists_url":"https://api.github.com/users/justinclift/gists{/gist_id}","starred_url":"https://api.github.com/users/justinclift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinclift/subscriptions","organizations_url":"https://api.github.com/users/justinclift/orgs","repos_url":"https://api.github.com/users/justinclift/repos","events_url":"https://api.github.com/users/justinclift/events{/privacy}","received_events_url":"https://api.github.com/users/justinclift/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":13,"state":"open","created_at":"2015-04-27T22:33:39Z","updated_at":"2015-05-24T16:21:43Z","due_on":"2015-06-07T23:00:00Z","closed_at":null},"comments":13,"created_at":"2014-11-27T20:22:25Z","updated_at":"2015-05-24T16:21:43Z","closed_at":"2015-05-24T16:21:43Z","body":"Hola,\r\n¿hay alguna forma de introducir funciones como valor DEFAULT para un campo?\r\nLo que necesito es el valor de hora UTC como entero con este esquema:\r\n\r\n     `timestamp` INTEGER NOT NULL DEFAULT (strftime('%s','now'))\r\n\r\nveo el código y parece que no es posible.\r\n\r\nSería útil una ampliación que aceptara esta funcionalidad.\r\nPor ejemplo, Visual FoxPro usa el \"=()\" para reconocer funciones:\r\n\r\n    =(expresion)\r\n\r\nen mi caso en particular podría entrar\r\n\r\n    =(strftime('%s','now'))\r\n\r\nUn cambio en EditTableDialog.cpp (lineas 347 y 348) podría ser este:\r\n\r\n    QChar ch = new_value.trimmed().at(0);\r\n    if(!( (ch == '\\'' || ch == '\"') && new_value.trimmed().endsWith(ch)  ))\r\n    {\r\n        if ( ch == '=' && new_value.trimmed().endsWith(')') && new_value.trimmed().at(1) == '(' )\r\n              new_value = new_value.trimmed().substring_function_I_dont_know(1);  // get rid of '='\r\n        else\r\n        //...\r\n\r\nNo conozco QT ni C++, pero es algo así.\r\n\r\nHe modificado el formato para darle claridad al código, también emparejo comillas simples con simples y dobles con dobles (la implementación actual acepta entradas como 'mydefault\").\r\n\r\nBueno, la idea está allí.\r\nGracias.\r\n"}}