-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
149 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Docs | ||
|
||
on: | ||
merge_group: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
|
||
concurrency: | ||
group: docs-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
jobs: | ||
create_documentation: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: update apt | ||
run: sudo apt -q update | ||
- name: install dependencies | ||
run: sudo apt install -y cmake ninja-build catch2 unixodbc-dev sqlite3 libsqlite3-dev libsqliteodbc valgrind uuid-dev g++-14 doxygen | ||
- name: cmake configure | ||
run: cmake --preset linux-gcc-release | ||
- name: build | ||
run: cmake --build --preset linux-gcc-release --target doc | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: html |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ vcpkg_installed/ | |
CMakeSettings.json | ||
compile_commands.json | ||
*.sqlite | ||
/html/ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
find_package(Doxygen) | ||
|
||
if(DOXYGEN_FOUND) | ||
message(STATUS "Doxygen found: ${DOXYGEN_EXECUTABLE}") | ||
|
||
FetchContent_Declare( | ||
doxygen-awesome-css | ||
GIT_REPOSITORY https://github.com/jothepro/doxygen-awesome-css.git | ||
GIT_TAG v2.3.4 | ||
) | ||
|
||
FetchContent_MakeAvailable(doxygen-awesome-css) | ||
|
||
# Halide-specific Doxygen options | ||
set(DOXYGEN_ALPHABETICAL_INDEX NO) | ||
set(DOXYGEN_BUILTIN_STL_SUPPORT YES) | ||
set(DOXYGEN_CASE_SENSE_NAMES NO) | ||
set(DOXYGEN_CLASS_DIAGRAMS NO) | ||
set(DOXYGEN_EXCLUDE bin) | ||
set(DOXYGEN_EXTRACT_ALL NO) | ||
set(DOXYGEN_EXTRACT_LOCAL_CLASSES NO) | ||
set(DOXYGEN_FILE_PATTERNS *.hpp) | ||
set(DOXYGEN_GENERATE_TREEVIEW YES) | ||
set(DOXYGEN_HIDE_UNDOC_CLASSES YES) | ||
set(DOXYGEN_HIDE_FRIEND_COMPOUNDS YES) | ||
set(DOXYGEN_HIDE_IN_BODY_DOCS YES) | ||
set(DOXYGEN_MARKDOWN_ID_STYLE GITHUB) | ||
set(DOXYGEN_QT_AUTOBRIEF YES) | ||
set(DOXYGEN_QUIET YES) | ||
set(DOXYGEN_RECURSIVE YES) | ||
set(DOXYGEN_REFERENCED_BY_RELATION YES) | ||
set(DOXYGEN_REFERENCES_RELATION YES) | ||
set(DOXYGEN_SORT_BY_SCOPE_NAME YES) | ||
set(DOXYGEN_SORT_MEMBER_DOCS NO) | ||
set(DOXYGEN_SOURCE_BROWSER YES) | ||
set(DOXYGEN_STRIP_CODE_COMMENTS NO) | ||
set(DOXYGEN_USE_MDFILE_AS_MAINPAGE "${PROJECT_SOURCE_DIR}/README.md") | ||
set(DOXYGEN_HTML_EXTRA_STYLESHEET "${CMAKE_BINARY_DIR}/_deps/doxygen-awesome-css-src/doxygen-awesome.css") | ||
set(DOXYGEN_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}") | ||
set(DOXYGEN_EXCLUDE_SYMBOLS "detail,detail::*,std,std::*,benchmark,test") | ||
|
||
doxygen_add_docs(doc | ||
"${PROJECT_SOURCE_DIR}/src;${PROJECT_SOURCE_DIR}/README.md;${PROJECT_SOURCE_DIR}/docs/usage.md" | ||
ALL | ||
COMMENT "Generate HTML documentation") | ||
|
||
|
||
else() | ||
message(WARNING "Doxygen not found, not generating documentation") | ||
endif() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
www.lightweight.org |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Examples | ||
|
||
# Configure connection to the database | ||
|
||
To connect to the database you need to provide connection string that library uses to establish connection and you can check if it alive in the following way | ||
```c | ||
SqlConnection::SetDefaultConnectionString(SqlConnectionString { | ||
.value = std::format("DRIVER=SQLite3;Database={}", SqlConnectionString::SanitizePwd("Database.sqlite")) }); | ||
|
||
auto sqlConnection = SqlConnection(); | ||
if (!sqlConnection.IsAlive()) | ||
{ | ||
std::println("Failed to connect to the database: {}", | ||
SqlErrorInfo::fromConnectionHandle(sqlConnection.NativeHandle())); | ||
std::abort(); | ||
} | ||
``` | ||
# Sql Query | ||
You can directly make a call to the database using `ExecuteDirect` function, for example | ||
```c | ||
auto stmt = SqlStatement {}; | ||
stmt.ExecuteDirect(R"("SELECT "a", "b", "c" FROM "That" ORDER BY "That"."b" DESC)")); | ||
while (stmt.FetchRow()) | ||
{ | ||
auto a = stmt.GetColumn<int>(1); | ||
auto b = stmt.GetColumn<int>(2); | ||
auto c = stmt.GetColumn<int>(3); | ||
std::println("{}|{}|{}", a, b,c); | ||
} | ||
``` | ||
|
||
Or you can constuct statement using `SqlQueryBuilder` for different databases | ||
```c | ||
auto sqliteQueryBuilder = SqlQueryBuilder(formatter); | ||
auto const sqlQuery = sqliteQueryBuilder.FromTable("That") | ||
.Select() | ||
.Fields("a", "b") | ||
.Field("c") | ||
.OrderBy(SqlQualifiedTableColumnName { .tableName = "That", .columnName = "b" }, | ||
SqlResultOrdering::DESCENDING) | ||
.All() | ||
|
||
``` | ||
For more info see `SqlQuery` and `SqlQueryFormatter` documentation |
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