text stringlengths 24 1.04M | metadata stringlengths 233 497 |
|---|---|
### File: dev/table.h
#pragma once
#include <string> // std::string
#include <type_traits> // std::remove_reference, std::is_same, std::decay
#include <vector> // std::vector
#include <tuple> // std::tuple_size, std::tuple_element
#include <utility> // std::forward, std::move
#include "functional/cxx_univer... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/table.h", "license": "mit", "size": 14231} |
### File: dev/table_info.h
#pragma once
#include <string> // std::string
#include "functional/cxx_universal.h"
namespace sqlite_orm {
struct table_info {
int cid = 0;
std::string name;
std::string type;
bool notnull = false;
std::string dflt_value;
int pk = 0;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/table_info.h", "license": "mit", "size": 1712} |
### File: dev/table_name_collector.h
#pragma once
#include <set> // std::set
#include <string> // std::string
#include <utility> // std::pair, std::move
#include "functional/cxx_type_traits_polyfill.h"
#include "type_traits.h"
#include "mapped_type_proxy.h"
#include "select_constraints.h"
#include "alias.h"
#in... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/table_name_collector.h", "license": "mit", "size": 3318} |
### File: dev/table_type_of.h
#pragma once
namespace sqlite_orm {
namespace internal {
template<class T, class F>
struct column_pointer;
template<class C>
struct indexed_column_t;
/**
* Trait class used to define table mapped type by setter/getter/member
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/table_type_of.h", "license": "mit", "size": 1153} |
### File: dev/tags.h
#pragma once
namespace sqlite_orm {
namespace internal {
struct negatable_t {};
/**
* Inherit from this class if target class can be chained with other conditions with '&&' and '||' operators
*/
struct condition_t {};
}
}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/tags.h", "license": "mit", "size": 275} |
### File: dev/transaction_guard.h
#pragma once
#include <functional> // std::function
#include <utility> // std::move
#include "connection_holder.h"
namespace sqlite_orm {
namespace internal {
/**
* Class used as a guard for a transaction. Calls `ROLLBACK` in destructor.
* Has e... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/transaction_guard.h", "license": "mit", "size": 2902} |
### File: dev/triggers.h
#pragma once
#include <memory>
#include <sstream>
#include <string>
#include <tuple>
#include "functional/cxx_universal.h"
#include "optional_container.h"
// NOTE Idea : Maybe also implement a custom trigger system to call a c++ callback when a trigger triggers ?
// (Could be implemented wit... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/triggers.h", "license": "mit", "size": 9715} |
### File: dev/tuple_helper/same_or_void.h
#pragma once
namespace sqlite_orm {
namespace internal {
/**
* Accepts any number of arguments and evaluates `type` alias as T if all arguments are the same or void otherwise
*/
template<class... Args>
struct same_or_void {
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/tuple_helper/same_or_void.h", "license": "mit", "size": 641} |
### File: dev/tuple_helper/tuple_filter.h
#pragma once
#include <type_traits> // std::integral_constant, std::index_sequence, std::conditional, std::declval
#include <tuple> // std::tuple
#include "../functional/cxx_universal.h"
#include "../functional/index_sequence_util.h"
namespace sqlite_orm {
n... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/tuple_helper/tuple_filter.h", "license": "mit", "size": 4115} |
### File: dev/tuple_helper/tuple_fy.h
#pragma once
#include <tuple>
namespace sqlite_orm {
namespace internal {
template<typename T>
struct tuplify {
using type = std::tuple<T>;
};
template<typename... Ts>
struct tuplify<std::tuple<Ts...>> {
using ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/tuple_helper/tuple_fy.h", "license": "mit", "size": 410} |
### File: dev/tuple_helper/tuple_iteration.h
#pragma once
#include <tuple> // std::tuple, std::get, std::tuple_element, std::tuple_size
#include <type_traits> // std::index_sequence, std::make_index_sequence
#include <utility> // std::forward, std::move
#include "../functional/cxx_universal.h"
#include "../func... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/tuple_helper/tuple_iteration.h", "license": "mit", "size": 5959} |
### File: dev/tuple_helper/tuple_traits.h
#pragma once
#include <type_traits> // std::is_same
#include <tuple>
#include "../functional/cxx_type_traits_polyfill.h"
#include "../functional/mpl.h"
namespace sqlite_orm {
namespace internal {
/*
* Higher-order trait metafunction that ch... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/tuple_helper/tuple_traits.h", "license": "mit", "size": 2456} |
### File: dev/tuple_helper/tuple_transformer.h
#pragma once
#include <tuple> // std::tuple
#include "../functional/mpl.h"
namespace sqlite_orm {
namespace internal {
template<class Tpl, template<class...> class Op>
struct tuple_transformer;
template<class... Types, template<class...> ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/tuple_helper/tuple_transformer.h", "license": "mit", "size": 688} |
### File: dev/type_is_nullable.h
#pragma once
#include <type_traits> // std::false_type, std::true_type, std::enable_if
#include <memory> // std::shared_ptr, std::unique_ptr
#include "functional/cxx_optional.h"
#include "functional/cxx_type_traits_polyfill.h"
namespace sqlite_orm {
/**
* This is class... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/type_is_nullable.h", "license": "mit", "size": 1562} |
### File: dev/type_printer.h
#pragma once
#include <string> // std::string
#include <memory> // std::shared_ptr, std::unique_ptr
#include <vector> // std::vector
#include "functional/cxx_optional.h"
#include "functional/cxx_type_traits_polyfill.h"
#include "type_traits.h"
#include "is_std_ptr.h"
namespace sqli... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/type_printer.h", "license": "mit", "size": 2900} |
### File: dev/type_traits.h
#pragma once
#include <type_traits> // std::enable_if, std::is_same
#include "functional/cxx_type_traits_polyfill.h"
namespace sqlite_orm {
// C++ generic traits used throughout the library
namespace internal {
template<class T, class... Types>
using is_any_of = ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/type_traits.h", "license": "mit", "size": 2136} |
### File: dev/typed_comparator.h
#pragma once
namespace sqlite_orm {
namespace internal {
template<class L, class R>
bool compare_any(const L& /*lhs*/, const R& /*rhs*/) {
return false;
}
template<class O>
bool compare_any(const O& lhs, const O& rhs) {
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/typed_comparator.h", "license": "mit", "size": 328} |
### File: dev/util.h
#pragma once
#include <sqlite3.h>
#include <string> // std::string
#include <utility> // std::move
#include "error_code.h"
namespace sqlite_orm {
/**
* Escape the provided character in the given string by doubling it.
* @param str A copy of the original string
* @para... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/util.h", "license": "mit", "size": 4380} |
### File: dev/values.h
#pragma once
#include <vector> // std::vector
#include <tuple> // std::tuple
#include <utility> // std::forward
#include "functional/cxx_universal.h"
#include "functional/cxx_type_traits_polyfill.h"
namespace sqlite_orm {
namespace internal {
template<class... Args>
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/values.h", "license": "mit", "size": 1025} |
### File: dev/values_to_tuple.h
#pragma once
#include <sqlite3.h>
#include <type_traits> // std::index_sequence, std::make_index_sequence
#include <tuple> // std::tuple, std::tuple_size, std::get
#include "functional/cxx_universal.h"
#include "row_extractor.h"
#include "arg_values.h"
namespace sqlite_orm {
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/values_to_tuple.h", "license": "mit", "size": 1713} |
### File: dev/view.h
#pragma once
#include <sqlite3.h>
#include <string> // std::string
#include <utility> // std::forward, std::move
#include <tuple> // std::tuple, std::make_tuple
#include "row_extractor.h"
#include "error_code.h"
#include "iterator.h"
#include "ast_iterator.h"
#include "prepared_statement.h"... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/view.h", "license": "mit", "size": 2219} |
### File: dev/xdestroy_handling.h
#pragma once
#include <type_traits> // std::integral_constant
#if defined(SQLITE_ORM_CONCEPTS_SUPPORTED) && SQLITE_ORM_HAS_INCLUDE(<concepts>)
#include <concepts>
#endif
#include "functional/cxx_universal.h"
#include "functional/cxx_type_traits_polyfill.h"
namespace sqlite_orm {
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "dev/xdestroy_handling.h", "license": "mit", "size": 9755} |
### File: examples/CMakeLists.txt
cmake_minimum_required (VERSION 3.16)
# note: find_package(SQLite3 REQUIRED) already done in top-level CMakeLists
file(GLOB files "*.cpp")
foreach(file ${files})
get_filename_component(file_basename ${file} NAME_WE)
add_executable(${file_basename} ${file})
# note: sqlite3... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/CMakeLists.txt", "license": "mit", "size": 402} |
### File: examples/blob.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <vector>
#include <iostream>
#include <cassert>
using std::cout;
using std::endl;
struct User {
int id;
std::string name;
std::vector<char> hash; // binary format
};
int main(int, char**) {
using namespace sq... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/blob.cpp", "license": "mit", "size": 1177} |
### File: examples/blob_binding.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
using namespace sqlite_orm;
using std::cout;
using std::endl;
/**
* This is a struct which we want to store as BLOB.
* Format is simple: every int field will be stored as
* 4 byte value one by one. 16 bytes total.
*/
str... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/blob_binding.cpp", "license": "mit", "size": 5325} |
### File: examples/case.cpp
/**
* Got it from here https://www.tutlane.com/tutorial/sqlite/sqlite-case-statement
*/
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
using namespace sqlite_orm;
using std::cout;
using std::endl;
int main() {
struct Student {
int id = 0;
std::string name;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/case.cpp", "license": "mit", "size": 4524} |
### File: examples/check.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
using namespace sqlite_orm;
using std::cout;
using std::endl;
int main() {
struct Contact {
int id = 0;
std::string firstName;
std::string lastName;
std::string email;
std:... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/check.cpp", "license": "mit", "size": 2871} |
### File: examples/chrono_binding.cpp
#include <sqlite_orm/sqlite_orm.h>
#if __cpp_lib_chrono >= 201907L && __cpp_lib_format >= 201907L
#define ENABLE_THIS_EXAMPLE
#endif
#ifdef ENABLE_THIS_EXAMPLE
#include <cassert>
#include <string>
#include <iostream>
#include <chrono>
#include <format>
///////////////////////////... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/chrono_binding.cpp", "license": "mit", "size": 5899} |
### File: examples/collate.cpp
#include <ctime>
#include <string>
#include <iostream>
#include <sqlite_orm/sqlite_orm.h>
using std::cout;
using std::endl;
struct User {
int id;
std::string name;
time_t createdAt;
};
struct Foo {
std::string text;
int baz;
};
int main(int, char**) {
using ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/collate.cpp", "license": "mit", "size": 1940} |
### File: examples/column_aliases.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <cassert>
using std::cout;
using std::endl;
using std::system_error;
using namespace sqlite_orm;
void marvel_hero_ordered_by_o_pos() {
struct MarvelHero {
int id = 0;
std::string name;
std... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/column_aliases.cpp", "license": "mit", "size": 2934} |
### File: examples/composite_key.cpp
/**
* This example shows you how to create a storage with a tablw with a composite primary key
* and another table woth foreign key to first table's primary compisite key.
*/
#include <cstdio>
#include <ctime>
#include <string>
#include <iostream>
#include <sqlite_orm/sqlite_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/composite_key.cpp", "license": "mit", "size": 1905} |
### File: examples/core_functions.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <cassert>
using std::cout;
using std::endl;
struct MarvelHero {
int id = 0;
std::string name;
std::string abilities;
short points = 0;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
MarvelHero() {}... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/core_functions.cpp", "license": "mit", "size": 53278} |
### File: examples/cross_join.cpp
/**
* The example is implemented from here http://www.sqlitetutorial.net/sqlite-cross-join/
*/
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
namespace DataModel {
struct Rank {
std::string rank;
};
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/cross_join.cpp", "license": "mit", "size": 2377} |
### File: examples/custom_aliases.cpp
/**
* Example is taken from here https://www.tutorialspoint.com/sqlite/sqlite_alias_syntax.htm
*/
#include <sqlite_orm/sqlite_orm.h>
#include <cassert>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
struct Employee {
int id = 0;
std::string n... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/custom_aliases.cpp", "license": "mit", "size": 5916} |
### File: examples/date_time.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <string>
using std::cout;
using std::endl;
struct DatetimeText {
std::string d1;
std::string d2;
};
int main() {
using namespace sqlite_orm;
auto storage = make_storage(
"",
make_table(... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/date_time.cpp", "license": "mit", "size": 3873} |
### File: examples/distinct.cpp
//
// This example is implemented from here https://www.tutorialspoint.com/sqlite/sqlite_distinct_keyword.htm
//
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
using std::cout;
using std::endl;
struct Employee {
int id;
std::string name;
int age;
std::string a... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/distinct.cpp", "license": "mit", "size": 3376} |
### File: examples/enum_binding.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <memory>
#include <cassert>
using std::cout;
using std::endl;
/**
* This is a enum we want to map to our sqlite db.
* First we have to decide what db type enum must have.
* Let's make it `TEXT`: Gender::Male wi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/enum_binding.cpp", "license": "mit", "size": 6205} |
### File: examples/except_intersection.cpp
/**
* Example is implemented from here https://www.tutlane.com/tutorial/sqlite/sqlite-except-operator
*/
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
struct DeptMaster {
int deptId = 0;
std::string dept... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/except_intersection.cpp", "license": "mit", "size": 3402} |
### File: examples/exists.cpp
/**
* Example is implemented from here https://www.w3resource.com/sqlite/exists-operator.php
*/
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
struct Customer {
std::string code;
std::string name;
std::string city... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/exists.cpp", "license": "mit", "size": 23091} |
### File: examples/fetch_content/CMakeLists.txt
### Preamble ###
cmake_minimum_required(VERSION 3.15)
project(Test VERSION 0.1 LANGUAGES CXX)
##### Project wide setup ####
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
### Dependencies ###
add_subdirectory(dependencies)
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/fetch_content/CMakeLists.txt", "license": "mit", "size": 315} |
### File: examples/fetch_content/dependencies/CMakeLists.txt
include(FetchContent)
# You can configure this for your need, presumbably you want speificy a git tag here instead of a branch
FetchContent_Declare(sqliteOrm
GIT_REPOSITORY https://github.com/fnc12/sqlite_orm
GIT_TAG origin/dev
)
add_subdirectory... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/fetch_content/dependencies/CMakeLists.txt", "license": "mit", "size": 272} |
### File: examples/fetch_content/dependencies/sqlite_orm/CMakeLists.txt
# Set here options for sliteOrm
# for example set(BUILD_TESTING ON) if you want to have tests included of sqliteOrm
FetchContent_MakeAvailable(sqliteOrm) | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/fetch_content/dependencies/sqlite_orm/CMakeLists.txt", "license": "mit", "size": 154} |
### File: examples/fetch_content/src/CMakeLists.txt
add_executable(Test)
target_link_libraries(Test PRIVATE sqlite_orm::sqlite_orm)
target_sources(Test
PRIVATE
main.cpp
) | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/fetch_content/src/CMakeLists.txt", "license": "mit", "size": 134} |
### File: examples/fetch_content/src/main.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
#include <cassert>
using namespace sqlite_orm;
using std::cout;
using std::endl;
struct RapArtist {
int id;
std::string name;
};
int main(int, char**) {
auto storage = make_storage(":... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/fetch_content/src/main.cpp", "license": "mit", "size": 1128} |
### File: examples/find_package/CMakeLists.txt
### Preamble ###
cmake_minimum_required(VERSION 3.15)
project(Test VERSION 0.1 LANGUAGES CXX)
##### Project wide setup ####
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
### Dependencies ###
find_package(SqliteOrm REQUIRED)
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/find_package/CMakeLists.txt", "license": "mit", "size": 317} |
### File: examples/find_package/src/CMakeLists.txt
add_executable(Test)
target_link_libraries(Test PRIVATE sqlite_orm::sqlite_orm)
target_sources(Test
PRIVATE
main.cpp
) | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/find_package/src/CMakeLists.txt", "license": "mit", "size": 134} |
### File: examples/find_package/src/main.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
#include <cassert>
using namespace sqlite_orm;
using std::cout;
using std::endl;
struct RapArtist {
int id;
std::string name;
};
int main(int, char**) {
auto storage = make_storage(":m... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/find_package/src/main.cpp", "license": "mit", "size": 1128} |
### File: examples/foreign_key.cpp
//
// The example is implemented from here https://sqlite.org/foreignkeys.html
//
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
#include <cassert>
#include <memory>
using std::cout;
using std::endl;
struct Artist {
int artistId;
std::string arti... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/foreign_key.cpp", "license": "mit", "size": 10324} |
### File: examples/generated_column.cpp
/**
* Thanks to that nice website https://database.guide/how-to-create-a-computed-column-in-sqlite/ for this example.
*/
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#if SQLITE_VERSION_NUMBER >= 3031000
using namespace sqlite_orm;
using std::cout;
using std::endl;... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/generated_column.cpp", "license": "mit", "size": 2260} |
### File: examples/group_by.cpp
//
// Example is implemented from here https://www.tutorialspoint.com/sqlite/sqlite_group_by.htm
//
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <string>
using std::cout;
using std::endl;
struct Employee {
int id;
std::string name;
int age;
std::str... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/group_by.cpp", "license": "mit", "size": 3263} |
### File: examples/having.cpp
/**
* Ths example is implemented from here https://www.tutorialspoint.com/sqlite/sqlite_having_clause.htm
*/
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
struct Employee {
int id;
std::string name;
int age;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/having.cpp", "license": "mit", "size": 2391} |
### File: examples/in_memory.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
#include <cassert>
using namespace sqlite_orm;
using std::cout;
using std::endl;
struct RapArtist {
int id;
std::string name;
};
int main(int, char**) {
auto storage = make_storage(":memory:",
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/in_memory.cpp", "license": "mit", "size": 1129} |
### File: examples/index.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
struct Contract {
std::string firstName;
std::string lastName;
std::string email;
};
using namespace sqlite_orm;
// beware - put `make_index` before `make_table` caus... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/index.cpp", "license": "mit", "size": 1847} |
### File: examples/insert.cpp
/**
* This code is an implementation of this article https://www.tutorialspoint.com/sqlite/sqlite_insert_query.htm
* with C++ specific features like creating object and inserting within
* single line and separately, inserting a subclass object and inserting a vector.
*/
#include <s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/insert.cpp", "license": "mit", "size": 3940} |
### File: examples/iteration.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <algorithm>
using std::cout;
using std::endl;
struct MarvelHero {
int id;
std::string name;
std::string abilities;
};
int main(int, char**) {
using namespace sqlite_orm;
auto storage = make_storage("... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/iteration.cpp", "license": "mit", "size": 2623} |
### File: examples/key_value.cpp
/******
This is an implementation of key-value storage just like
NSUserDefaults on iOS or SharedPreferences on Android.
Here is the deal: we need to have `setValueForKey` and `getValueByKey` interface. All data must ba saved in sqlite
database.
To perform this we create schema wit... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/key_value.cpp", "license": "mit", "size": 3022} |
### File: examples/left_and_inner_join.cpp
/**
* Example is imlemented from here http://www.sqlitetutorial.net/sqlite-left-join/
* In this example you got to download db file 'chinook.db' first from here
* http://www.sqlitetutorial.net/sqlite-sample-database/ an place the file near executable.
*/
#include <sqlit... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/left_and_inner_join.cpp", "license": "mit", "size": 11885} |
### File: examples/multi_table_select.cpp
/**
* Example implemented from here http://sqlite.awardspace.info/syntax/sqlitepg05.htm
*/
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
struct ReqEquip {
int reqNumber;
std::string requestor;
std::s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/multi_table_select.cpp", "license": "mit", "size": 3467} |
### File: examples/natural_join.cpp
/**
* Implemented this example https://www.w3resource.com/sqlite/sqlite-natural-join.php
*/
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
struct Doctor {
int doctor_id;
std::string doctor_name;
std::string... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/natural_join.cpp", "license": "mit", "size": 4262} |
### File: examples/nullable_enum_binding.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <memory>
#include <string>
using std::cout;
using std::endl;
/**
* Gender is gonna me stored as a nullable TEXT.
* None is gonna be NULL,
* Male - 'male' string,
* Female - 'female' string
*/
enum cl... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/nullable_enum_binding.cpp", "license": "mit", "size": 4256} |
### File: examples/pointer_passing_interface.cpp
/**
* Example of how to use the pointer-passing interface, creating an ad-hoc sqlite extension.
*
* It demonstrates how to modularize turning a seralized representation of an object
* into C/C++ native object instance, plus invoking operations on that object.
* ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/pointer_passing_interface.cpp", "license": "mit", "size": 9164} |
### File: examples/prepared_statement.cpp
/**
* There are two member functions in storage_t class which you need to use to operate with
* prepared statements: storage_t::prepare and storage_t::execute.
* Also if you need to rebind arguments just use get<N>(statement) = ... syntax
* just like you do with std::tu... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/prepared_statement.cpp", "license": "mit", "size": 9006} |
### File: examples/private_class_members.cpp
/**
* Sometimes data model classes may have private/protected fields to
* be mapped to a storage. In this case you have to pass setter and getter
* function instead of member pointer. Also to specify a column in select
* or where condition you have to add getter or s... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/private_class_members.cpp", "license": "mit", "size": 2623} |
### File: examples/select.cpp
/****
Implemented example from here https://www.tutorialspoint.com/sqlite/sqlite_select_query.htm.
*/
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
using namespace sqlite_orm;
using std::cout;
using std::endl;
using std::make_unique;
using std::string;
void all_employees() {... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/select.cpp", "license": "mit", "size": 6345} |
### File: examples/self_join.cpp
//
// This example is obtained from here http://www.sqlitetutorial.net/sqlite-self-join/
//
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <cassert>
using std::cout;
using std::endl;
struct Employee {
int employeeId;
std::string lastName;
std::string fir... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/self_join.cpp", "license": "mit", "size": 9169} |
### File: examples/subentities.cpp
/**
* Our goal is to manage a Student class. Student has basic id, name and roll_number and one more thing:
* vector of marks. Mark is a subentity with one to many relation. This example shows how to manage this kind of case.
* First of all we got to understand how to keep data ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/subentities.cpp", "license": "mit", "size": 4195} |
### File: examples/subquery.cpp
/**
* Implemented from here https://www.w3resource.com/sqlite/sqlite-subqueries.php
*/
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <memory>
#include <iostream>
using std::cout;
using std::endl;
struct Employee {
int id;
std::string firstName;
std::strin... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/subquery.cpp", "license": "mit", "size": 58654} |
### File: examples/synchronous.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <string>
struct Query {
std::string src_ip;
uint16_t src_port;
uint16_t txn_id;
uint32_t tv_sec;
uint32_t tv_usec;
std::string name;
uint16_t type;
};
int main(int, char**) {
using namespace sqlite_orm;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/synchronous.cpp", "license": "mit", "size": 1078} |
### File: examples/triggers.cpp
/**
* This example was grabbed from here https://www.sqlitetutorial.net/sqlite-trigger/
*/
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <string>
using namespace sqlite_orm;
using std::cout;
using std::endl;
struct Lead {
int id = 0;
std::string firstName;... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/triggers.cpp", "license": "mit", "size": 9705} |
### File: examples/union.cpp
/**
* This example was grabbed from here https://www.tutorialspoint.com/sqlite/sqlite_unions_clause.htm
*/
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <cassert>
#include <algorithm>
#include <iostream>
using std::cout;
using std::endl;
int main() {
struct Employ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/union.cpp", "license": "mit", "size": 4538} |
### File: examples/unique.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <string>
#include <memory>
#include <iostream>
using std::cerr;
using std::cout;
using std::endl;
struct Entry {
int id;
std::string uniqueColumn;
std::unique_ptr<std::string> nullableColumn;
};
int main(int, char**) {
using n... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/unique.cpp", "license": "mit", "size": 1367} |
### File: examples/update.cpp
/**
* Example implemented from here https://www.tutorialspoint.com/sqlite/sqlite_update_query.htm
*/
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
#include <memory>
using std::cout;
using std::endl;
struct Employee {
int id;
std::string name;
int age;
std::st... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/update.cpp", "license": "mit", "size": 2648} |
### File: examples/user_defined_functions.cpp
/**
* This example was taken from here http://souptonuts.sourceforge.net/readme_sqlite_tutorial.html
*/
#include <sqlite_orm/sqlite_orm.h>
#include <iostream>
using namespace sqlite_orm;
using std::cout;
using std::endl;
/**
* Scalar function must be defined as a ded... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "examples/user_defined_functions.cpp", "license": "mit", "size": 5947} |
### File: include/sqlite_orm/sqlite_orm.h
#pragma once
#if defined(_MSC_VER)
__pragma(push_macro("min"))
#undef min
__pragma(push_macro("max"))
#undef max
#endif // defined(_MSC_VER)
#pragma once
// #include "cxx_universal.h"
/*
* This header makes central C++ functionality on which sqlite_orm depends universally... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "include/sqlite_orm/sqlite_orm.h", "license": "mit", "size": 716113} |
### File: not_single_header_include/sqlite_orm/sqlite_orm.h
#pragma once
#include "../../dev/functional/start_macros.h"
// though each header is required to include everything it needs
// we include the configuration and all underlying c++ core features in order to make it universally available
#include "../../dev/fun... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/sqlite_orm", "path": "not_single_header_include/sqlite_orm/sqlite_orm.h", "license": "mit", "size": 1444} |
### File: packaging/CMakeLists.txt
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
set(SQLITE_ORM_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/SqliteOrm CACHE STRING "Path to SqliteOrm cmake files")
configure_file(${PROJECT_SOURCE_DIR}/cmake/SqliteOrmConfig.cmake.in SqliteOrmConfig.cmake @ONLY)
write_ba... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "packaging/CMakeLists.txt", "license": "mit", "size": 1315} |
### File: tests/CMakeLists.txt
cmake_minimum_required (VERSION 3.16)
# note: find_package(SQLite3 REQUIRED) already done in top-level CMakeLists
FetchContent_MakeAvailable(Catch2)
option(SQLITE_ORM_OMITS_CODECVT "Omits codec testing" OFF)
add_executable(unit_tests
static_tests/functional/static_if_tests.cpp
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/CMakeLists.txt", "license": "mit", "size": 6528} |
### File: tests/ast_iterator_tests.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
#include <typeindex> // std::type_index
using namespace sqlite_orm;
using internal::alias_column_t;
using internal::alias_holder;
using internal::column_alias;
using internal::column_pointer;
using internal::it... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/ast_iterator_tests.cpp", "license": "mit", "size": 11068} |
### File: tests/backup_tests.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
#include <cstdio> // remove
using namespace sqlite_orm;
namespace {
struct User {
int id = 0;
std::string name;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
User() = default;
User... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/backup_tests.cpp", "license": "mit", "size": 5820} |
### File: tests/built_in_functions_tests/core_functions_tests.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("substr") {
struct Test {
std::string text;
int x = 0;
int y = 0;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/built_in_functions_tests/core_functions_tests.cpp", "license": "mit", "size": 57620} |
### File: tests/built_in_functions_tests/datetime_function_tests.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("time") {
auto storage = make_storage({});
{
auto rows = storage.select(time("12:00", "localtime"));
REQUIRE(rows.size()... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/built_in_functions_tests/datetime_function_tests.cpp", "license": "mit", "size": 1938} |
### File: tests/built_in_functions_tests/math_functions.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
#ifdef SQLITE_ENABLE_MATH_FUNCTIONS
constexpr double Epsilon = 0.0001;
static bool is_double_eq(double a, double b, double epsilon) {
return ((a - b) < epsilo... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/built_in_functions_tests/math_functions.cpp", "license": "mit", "size": 15082} |
### File: tests/column_tests.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("column tests is_generated") {
struct User {
int id = 0;
int age = 0;
};
SECTION("no constraints") {
auto column = make_column("id", &User::id);... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/column_tests.cpp", "license": "mit", "size": 929} |
### File: tests/constraints/check.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("check") {
SECTION("table level") {
struct Contact {
int id = 0;
std::string firstName;
std::string lastName;
std::... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/constraints/check.cpp", "license": "mit", "size": 2457} |
### File: tests/constraints/composite_key.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("Composite key") {
struct Record {
int year = 0;
int month = 0;
int amount = 0;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Recor... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/constraints/composite_key.cpp", "license": "mit", "size": 2690} |
### File: tests/constraints/default.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
// appeared after #55
TEST_CASE("Default value") {
struct User {
int userId;
std::string name;
int age;
std::string email;
};
auto filena... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/constraints/default.cpp", "license": "mit", "size": 2508} |
### File: tests/constraints/foreign_key.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
#include <type_traits> // std::is_same
#include "../static_tests/static_tests_storage_traits.h"
using namespace sqlite_orm;
TEST_CASE("Foreign key") {
struct Location {
int id;
std::... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/constraints/foreign_key.cpp", "license": "mit", "size": 4404} |
### File: tests/constraints/unique.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("Unique") {
using Catch::Matchers::ContainsSubstring;
struct Contact {
int id = 0;
std::string firstName;
std::string lastName;
std::... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/constraints/unique.cpp", "license": "mit", "size": 2600} |
### File: tests/explicit_columns.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("Explicit columns") {
struct Object {
int id;
};
struct User : Object {
std::string name;
User(decltype(id) id_, decltype(name) name_) : O... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/explicit_columns.cpp", "license": "mit", "size": 3099} |
### File: tests/filename.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("filename") {
{
auto storage = make_storage("");
REQUIRE(storage.filename() == "");
}
{
auto storage = make_storage(":memory:");
REQUIRE(sto... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/filename.cpp", "license": "mit", "size": 461} |
### File: tests/get_all_custom_containers.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
#include <list>
#include <deque>
using namespace sqlite_orm;
namespace {
struct User {
int id = 0;
std::string name;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
User() = defa... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/get_all_custom_containers.cpp", "license": "mit", "size": 4986} |
### File: tests/index_tests.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("index") {
struct User {
int id = 0;
std::string name;
};
auto table = make_table("users", make_column("id", &User::id), make_column("name", &User::name... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/index_tests.cpp", "license": "mit", "size": 4909} |
### File: tests/json.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
#ifdef SQLITE_ENABLE_JSON1
TEST_CASE("json") {
auto storage = make_storage("");
std::vector<std::string> expected;
std::vector<std::string> rows;
rows = storage.select(json(" { \"thi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/json.cpp", "license": "mit", "size": 16309} |
### File: tests/operators/arithmetic_operators.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("Arithmetic operators") {
struct Object {
std::string name;
int nameLen;
int number;
};
auto storage = make_storage("",
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/operators/arithmetic_operators.cpp", "license": "mit", "size": 7442} |
### File: tests/operators/between.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("Between") {
struct Object {
int id = 0;
};
auto storage =
make_storage("", make_table("objects", make_column("id", &Object::id, primary_key().aut... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/operators/between.cpp", "license": "mit", "size": 640} |
### File: tests/operators/binary_operators.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("binary operators") {
using Catch::Matchers::UnorderedEquals;
struct User {
int id = 0;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
User() ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/operators/binary_operators.cpp", "license": "mit", "size": 5265} |
### File: tests/operators/bitwise.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("bitwise operators") {
struct Entry {
int lhs = 0;
int rhs = 0;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Entry() = default;
Entry(int ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/operators/bitwise.cpp", "license": "mit", "size": 1863} |
### File: tests/operators/cast.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("Cast") {
struct Student {
int id;
float scoreFloat;
std::string scoreString;
};
auto storage = make_storage("",
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/operators/cast.cpp", "license": "mit", "size": 1112} |
### File: tests/operators/glob.cpp
/**
* Obtained from here https://www.tutlane.com/tutorial/sqlite/sqlite-glob-operator
*/
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
#include <vector> // std::vector
#include <algorithm> // std::find_if, std::count
using namespace sqlite_orm;
namespace ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/operators/glob.cpp", "license": "mit", "size": 3802} |
### File: tests/operators/in.cpp
#include <sqlite_orm/sqlite_orm.h>
#include <catch2/catch_all.hpp>
using namespace sqlite_orm;
TEST_CASE("In") {
using Catch::Matchers::UnorderedEquals;
{
struct User {
int id = 0;
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
User() = default;
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/sqlite_orm", "path": "tests/operators/in.cpp", "license": "mit", "size": 4036} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.