Skip to content

Feature: Adding sqlite persistence applying migrations to sqlite #389

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 27, 2025

Conversation

orkes-venkat
Copy link
Contributor

@orkes-venkat orkes-venkat commented Feb 12, 2025

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • WHOSUSING.md
  • Other (please describe):

NOTE: Please remember to run ./gradlew spotlessApply to fix any format violations.

Changes in this PR

Describe the new behavior from this PR, and why it's needed
Adding Sqlite based implementation in the conductor repo, in this PR i have added migration steps to migrate the tables to sqlite

Alternatives considered

Describe alternative implementation you have considered

@orkes-venkat orkes-venkat changed the title Sqlite persistence Adding Migrations to Sqlite Feb 12, 2025
@v1r3n v1r3n marked this pull request as draft February 12, 2025 05:49
@orkes-venkat orkes-venkat changed the title Adding Migrations to Sqlite Feature: Adding sqlite persistence applying migrations to sqlite Feb 12, 2025
while (null != causeException && !(causeException instanceof SQLException)) {
causeException = causeException.getCause();
}
return (SQLException) causeException;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we verified, it will always be an SQLException ?

super(retryTemplate, objectMapper, dataSource);
this.scheduledExecutorService =
Executors.newSingleThreadScheduledExecutor(
ExecutorsUtil.newNamedThreadFactory("postgres-execution-"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postgres-execution- ?

super(retryTemplate, objectMapper, dataSource);
this.properties = properties;
this.executorService = null;
// this.properties = properties;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mercilessly remove unused code :) . You can get it from version history if it is ever relevant.

DataSource dataSource,
SqliteProperties properties) {
super(retryTemplate, objectMapper, dataSource);
// //this.pollDataFlushInterval = properties.getPollDataFlushInterval().toMillis();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove if not required

TimeUnit.MILLISECONDS);
logger.debug("{} is ready to serve", SqliteBaseDAO.class.getName());

// if (properties.getExperimentalQueueNotify()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove if not required

@@ -0,0 +1,37 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may have nothing specific to sqlite. This is potentially more of a common util ?

import java.util.function.Supplier;

/** Functional class to support the lazy execution of a String result. */
public class LazyToString {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Common util ?

* @author mustafa
*/
@FunctionalInterface
public interface QueryFunction<R> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DB, but not sqlite specific ? package and module

@v1r3n v1r3n merged commit b128e78 into main Feb 27, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants