<commit_before>// SETUP
// GET, SET, ADD, REPLACE, DELETE, CAS, FLUSH_ALL, INCR, DECR, APPEND, PREPEND, STATS

// TODO find way to interact with postgres / peloton?

SET
insert into test (k, d) values ('$key', '$value') on conflict (k) do update set d = excluded.d;

GET
select d from test where k = '$key';<commit_msg>WIP prepared statements<commit_after>// SETUP
// GET, SET, ADD, REPLACE, DELETE, CAS, FLUSH_ALL, INCR, DECR, APPEND, PREPEND, STATS

// TODO find way to interact with postgres / peloton?

// prepared statements
// execute only once
int setup() {
CREATE TABLE test ( k VARCHAR(40) PRIMARY KEY, d VARCHAR(400) );

DEALLOCATE SET;
PREPARE SET (text, text) AS
  INSERT INTO test (k, d) VALUES ($1, $2) ON CONFLICT (k) DO UPDATE SET d = excluded.d;

DEALLOCATE GET;
PREPARE GET (text) AS
  SELECT d FROM TEST WHERE k = $1;
}

int get(std::string &key, std::string &value) {
  EXECUTE SET (,)
}

int get(std::string &key, std::string &value) {
  EXECUTE SET (,)
}
{'fraction_non_alphanumeric': 0.1362704918032787, 'fraction_numerical': 0.00819672131147541, 'mean_word_length': 4.01025641025641, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6806777', 'n_tokens_mistral': 369, 'n_tokens_neox': 347, 'n_words': 136}