Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
69e0401
initial commit of encryption plugin
davecramer Sep 22, 2025
0436a58
working code
davecramer Sep 22, 2025
31af2a0
updated packages and added license files
davecramer Sep 23, 2025
1e03bf6
moved to correct package and now compiles
davecramer Sep 23, 2025
97bca78
recovered the parser code
davecramer Sep 23, 2025
d15099a
fix javadoc warnings
davecramer Sep 23, 2025
5fdf65b
removed reflection and added test for SqlAnalysisService
davecramer Sep 23, 2025
453cc43
add AwsWrapperProperty to EncryptionConfig
davecramer Sep 23, 2025
c7abee8
cleaned up the configuration properties and added docs
davecramer Sep 23, 2025
b88bebf
working code
davecramer Sep 23, 2025
5a98af9
update SQLAnalyzer to handle more complex joins
davecramer Sep 24, 2025
07cc89e
refactored to use jooq parser instead of our own PostgreSQL parser
davecramer Sep 24, 2025
2bac0c3
refactored to use jooq parser instead of our own PostgreSQL parser
davecramer Sep 24, 2025
ab15999
removed jooq and used JSQLParser
davecramer Sep 25, 2025
6e2810d
removed unused methods fixed documentation
davecramer Sep 25, 2025
c534c9a
added end to end encryption test and fixed where clause column mapping
davecramer Sep 26, 2025
d1bbdfe
create KeyManagementUtilityIntegration test and change the KmsEncrypt…
davecramer Sep 26, 2025
340c9b8
fix useless test
davecramer Sep 26, 2025
73c6031
changed key_storage to use an integer id
davecramer Sep 26, 2025
fab833d
remember where we are
davecramer Sep 26, 2025
bc0567f
finished switching to JUL
davecramer Sep 27, 2025
1585afb
removed all Jooq, updated SqlAnalyzer to handle columns better fixed …
davecramer Oct 15, 2025
1eb5252
Parser now handles more complex queries
davecramer Oct 15, 2025
fe706ca
make sure the parser can handle schema qualified names and add a sche…
davecramer Oct 16, 2025
4fab4a6
added a property ENCRYPTION_METADATA_SCHEMA to specify the schema tha…
davecramer Oct 16, 2025
36eeb97
run the KmsEncryptionIntegrationTest
davecramer Oct 17, 2025
58b3e17
Now encrypt the data with HMAC and store the HMAC salt with the data …
davecramer Nov 6, 2025
5a1b902
Use HMAC to verify encryption
davecramer Nov 10, 2025
7d149f0
working now that we use binary transfer and an EncryptedData PGObject
davecramer Nov 10, 2025
bdea863
add in the extension code
davecramer Nov 12, 2025
74fba5b
removed the extension code that created the encrypted_data type, use …
davecramer Nov 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package software.amazon.jdbc.benchmarks;

import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.runner.Runner;
import org.openjdk.jmh.runner.RunnerException;
import org.openjdk.jmh.runner.options.Options;
import org.openjdk.jmh.runner.options.OptionsBuilder;
import software.amazon.jdbc.plugin.encryption.parser.PostgreSqlParser;

import java.util.concurrent.TimeUnit;

@BenchmarkMode(Mode.AverageTime)
@OutputTimeUnit(TimeUnit.MICROSECONDS)
@State(Scope.Benchmark)
@Fork(1)
@Warmup(iterations = 3, time = 1, timeUnit = TimeUnit.SECONDS)
@Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS)
public class ParserBenchmark {

private PostgreSqlParser parser;

@Setup
public void setup() {
parser = new PostgreSqlParser();
}

@Benchmark
public void parseSimpleSelect() {
parser.parse("SELECT * FROM users");
}

@Benchmark
public void parseSelectWithWhere() {
parser.parse("SELECT id, name FROM users WHERE age > 25");
}

@Benchmark
public void parseSelectWithOrderBy() {
parser.parse("SELECT * FROM products ORDER BY price DESC");
}

@Benchmark
public void parseComplexSelect() {
parser.parse("SELECT u.name, o.total FROM users u, orders o WHERE u.id = o.user_id AND o.total > 100");
}

@Benchmark
public void parseInsert() {
parser.parse("INSERT INTO users (name, age, email) VALUES ('John', 30, 'john@example.com')");
}

@Benchmark
public void parseInsertWithPlaceholders() {
parser.parse("INSERT INTO users (name, age, email) VALUES (?, ?, ?)");
}

@Benchmark
public void parseUpdate() {
parser.parse("UPDATE users SET name = 'Jane', age = 25 WHERE id = 1");
}

@Benchmark
public void parseUpdateWithPlaceholders() {
parser.parse("UPDATE users SET name = ?, age = ? WHERE id = ?");
}

@Benchmark
public void parseDelete() {
parser.parse("DELETE FROM users WHERE age < 18");
}

@Benchmark
public void parseCreateTable() {
parser.parse("CREATE TABLE products (id INTEGER PRIMARY KEY, name VARCHAR NOT NULL, price DECIMAL)");
}

@Benchmark
public void parseComplexExpression() {
parser.parse("SELECT * FROM orders WHERE (total > 100 AND status = 'pending') OR (total > 500 AND status = 'shipped')");
}

@Benchmark
public void parseScientificNotation() {
parser.parse("INSERT INTO measurements VALUES (42, 3.14159, 2.5e10)");
}

public static void main(String[] args) throws RunnerException {
Options opt = new OptionsBuilder()
.include(ParserBenchmark.class.getSimpleName())
.build();

new Runner(opt).run();
}
}
Loading