Skip to content

Latest commit

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Nodepp SQLite Wrapper

...

Dependencies & Cmake Integration

#libsqlite3-dev
🪟: pacman -S mingw-w64-ucrt-x86_64-sqlite3
🐧: sudo apt install libsqlite3-dev
include(FetchContent)
FetchContent_Declare(
nodepp
GIT_REPOSITORY https://github.com/NodeppOfficial/nodepp
GIT_TAG origin/main
GIT_PROGRESS ON
)
FetchContent_MakeAvailable(nodepp)
FetchContent_Declare(
nodepp-sqlite
GIT_REPOSITORY https://github.com/NodeppOfficial/nodepp-sqlite
GIT_TAG origin/main
GIT_PROGRESS ON
)
FetchContent_MakeAvailable(nodepp-sqlite)
#[...]
target_link_libraries( #[...]
PUBLIC nodepp nodepp-sqlite #[...]
)

Getting Started

#include<nodepp/nodepp.h>
#include<sqlite/sqlite.h>usingnamespacenodepp;voidmain() {
// 1. Establish connection (synchronously wait for connection)try {
auto db = sqlite::add("my_database.db");
// 2. Execute a command synchronouslyif(
!db.emit("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT);");
){ throwexcept_t( "something went wrong" ); }
console::log("Database and table initialized successfully.");
} catch( except_t error ) {
console::error("Database initialization failed:", error.what());
}
}

Compilation

g++ -o main main.cpp -I ./include -lsqlite3 ; ./main

License

Nodepp-SQLite is distributed under the MIT License. See the LICENSE file for more details.

About

A Simple SQLITE Connector for Nodepp

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages