Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
EngineProperties.h
Go to the documentation of this file.
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Database_SQL_EngineProperties_h_
5#define _Stroika_Foundation_Database_SQL_EngineProperties_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include <string_view>
10
12
13/**
14 * \file
15 *
16 *
17 * \note Code-Status: <a href="Code-Status.md#Alpha">Alpha</a>
18 */
19
20namespace Stroika::Foundation::Database::SQL {
21
22 using Characters::String;
23
24 /**
25 * \brief EngineProperties captures the features associated with a given database engine (being talked to through a SQL::Connection::Ptr).
26 *
27 * @todo This will require significant building out/elaboration to support more database backends
28 * with the ORM (or any attempted cross-database-portable) applicaiton.
29 */
31 public:
32 /**
33 */
34 EngineProperties () = default;
35
36 public:
37 /**
38 */
39 virtual ~EngineProperties () = default;
40
41 public:
42 /**
43 */
44 virtual String GetEngineName () const = 0;
45
46 public:
47 /**
48 */
49 static constexpr inline string_view kDoesTableExistParameterName{":TABLENAME"sv};
50
51 public:
52 /**
53 */
54 enum NonStandardSQL {
55 // variable name for parameter is :TABLENAME
56 // @todo docs return
57 eDoesTableExist,
58 };
59
60 public:
61 /**
62 */
63 virtual String GetSQL (NonStandardSQL n) const = 0;
64
65 public:
66 // From https://www.sqlite.org/lang_transaction.html
67 // An implicit transaction (a transaction that is started automatically, not a transaction started by BEGIN)
68 // is committed automatically when the last active statement finishes. A statement finishes when its last cursor closes,
69 // which is guaranteed to happen when the prepared statement is reset or finalized.
70 virtual bool RequireStatementResetAfterModifyingStatmentToCompleteTransaction () const = 0;
71
72 public:
73 virtual bool SupportsNestedTransactions () const = 0;
74 };
75
76}
77
78/*
79 ********************************************************************************
80 ***************************** Implementation Details ***************************
81 ********************************************************************************
82 */
83#include "EngineProperties.inl"
84
85#endif /*_Stroika_Foundation_Database_SQL_EngineProperties_h_*/
String is like std::u32string, except it is much easier to use, often much more space efficient,...
Definition String.h:201
EngineProperties captures the features associated with a given database engine (being talked to throu...