diff options
| author | Thorsten Töpper <atsutane@freethoughts.de> | 2026-02-18 21:51:53 +0100 |
|---|---|---|
| committer | Thorsten Töpper <atsutane@freethoughts.de> | 2026-02-18 21:51:53 +0100 |
| commit | d513977a3566b14d9357906615d045d71741537f (patch) | |
| tree | 3e707d2de9da71d98650fa8bb1b92ed11ab724ba /include/database_interaction.h | |
| parent | eed2d1323441861f2d41f0ecc0a72fcc9190fa5f (diff) | |
| download | duplicate_finder-d513977a3566b14d9357906615d045d71741537f.tar.gz duplicate_finder-d513977a3566b14d9357906615d045d71741537f.tar.bz2 | |
squash initial implementation
Diffstat (limited to 'include/database_interaction.h')
| -rw-r--r-- | include/database_interaction.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/database_interaction.h b/include/database_interaction.h new file mode 100644 index 0000000..9ae0da7 --- /dev/null +++ b/include/database_interaction.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: Apache-2.0 */ + +/* Copyright 2026 Thorsten Töpper + * + * vim:ts=4:sw=4:expandtab + */ +#ifndef DATABASE_INTERACTION_H +#define DATABASE_INTERACTION_H + +#include "file_processor.h" + +/*=========== FUNCTIONS ===========*/ +bool dbi_open(char *filename); +void dbi_close(); + +char *dbi_select_filename_by_id(int64_t id); +int64_t dbi_select_filename_by_name(const char *name); +int dbi_insert_filename(const char *filename); + +char *dbi_select_path_by_id(int64_t id); +int64_t dbi_select_path_by_pathname(const char *pathname); +int dbi_insert_pathname(const char *path); + +struct df_hashstrings *dbi_select_hashes_by_id(int64_t id); +int64_t dbi_select_hashes_by_strings(const char *blake2, const char *sha256, const char *sha512); +int dbi_insert_hashes(const char *blake2, const char *sha256, const char *sha512); + +int64_t dbi_select_fileinfo_by_hash_path_filename_ids(int64_t hash_id, int64_t path_id, int64_t filename_id); +int64_t dbi_select_fileinfo_by_path_filename_ids(int64_t pname_id, int64_t fname_id); +int dbi_insert_fileinfo(struct df_fileinfo *fi); + +int dbi_update_fileinfo_last_seen(int64_t id); +int dbi_update_fileinfo_complete(struct df_fileinfo *fi, int64_t existing_id); +#endif |
