Refactored CMS_MODULE.router (..): WSF_ROUTER design, to create only one router object of type CMS_ROUTER. Added optional CMS_NODE.link: CMS_LOCAL_LINK Reviewed permissions related to node module. Refactor and add CMS_STORAGE_SQL(_BUILDER) abstractions for implementation relying only on SQL statements. Factorized sql builder initialization (to work for sqlite and mysql storage builders). Added CMS_RESPONSE.formatted_string (a_text: READABLE_STRING_GENERAL; args: TUPLE): STRING_32 Added function "translation", but not implemented for now. Updated indexing notes and comments. Code cleaning.
54 lines
1.3 KiB
Plaintext
54 lines
1.3 KiB
Plaintext
note
|
|
description: "[
|
|
Interface responsible to instantiate CMS_STORAGE_SQLITE object.
|
|
]"
|
|
author: "$Author: jfiat $"
|
|
date: "$Date: 2015-02-13 13:08:13 +0100 (ven., 13 févr. 2015) $"
|
|
revision: "$Revision: 96616 $"
|
|
|
|
class
|
|
CMS_STORAGE_SQLITE_BUILDER
|
|
|
|
inherit
|
|
CMS_STORAGE_STORE_SQL_BUILDER
|
|
|
|
GLOBAL_SETTINGS
|
|
|
|
create
|
|
make
|
|
|
|
feature {NONE} -- Initialization
|
|
|
|
make
|
|
-- Initialize `Current'.
|
|
do
|
|
end
|
|
|
|
feature -- Factory
|
|
|
|
storage (a_setup: CMS_SETUP): detachable CMS_STORAGE_SQLITE
|
|
local
|
|
s: STRING
|
|
conn: DATABASE_CONNECTION
|
|
do
|
|
if attached (create {APPLICATION_JSON_CONFIGURATION_HELPER}).new_database_configuration (a_setup.environment.application_config_path) as l_database_config then
|
|
s := "Driver=SQLite3 ODBC Driver;Database="
|
|
if attached l_database_config.database_name as db_name then
|
|
s.append (db_name)
|
|
end
|
|
s.append (";LongNames=0;Timeout=1000;NoTXN=0;SyncPragma=NORMAL;StepAPI=0;")
|
|
create {DATABASE_CONNECTION_ODBC} conn.login_with_connection_string (s)
|
|
if conn.is_connected then
|
|
create Result.make (conn)
|
|
set_map_zero_null_value (False) --| This way we map 0 to 0, instead of Null as default.
|
|
if Result.is_available then
|
|
if not Result.is_initialized then
|
|
initialize (a_setup, Result)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
end
|