$ docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyramid.security import NO_PERMISSION_REQUIRED | |
def includeme(config): | |
config.add_directive( | |
'add_cors_preflight_handler', add_cors_preflight_handler) | |
config.add_route_predicate('cors_preflight', CorsPreflightPredicate) | |
config.add_subscriber(add_cors_to_response, 'pyramid.events.NewResponse') | |
class CorsPreflightPredicate(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- splitting as columns | |
-- | |
select regexp_substr('a-b-c', '[^-]+', 1, 1) as grupo_1 | |
,regexp_substr('a-b-c', '[^-]+', 1, 2) as grupo_2 | |
,regexp_substr('a-b-c', '[^-]+', 1, 3) as grupo_3 | |
from dual; | |
-- result: | |
-- a b c |
With expo-sqlite
it's not possible to execute few depending statements inside single transaction - db.transaction
does not work with async/promise and tx.executeSql
just enqueues sql statement but does not execute it.
Database
class has two methods - execute
(to execute single statement without transaction) and transaction(cb)
to execute few statements inside a transaction