diff --git a/impl/sql/pom.xml b/impl/sql/pom.xml new file mode 100644 index 0000000..dead6e5 --- /dev/null +++ b/impl/sql/pom.xml @@ -0,0 +1,29 @@ + + + + easyconfiguration-parent + cc.carm.lib + 3.1.0 + ../../pom.xml + + 4.0.0 + + ${java.version} + ${java.version} + + easyconfiguration-sql + + + + + ${project.parent.groupId} + easyconfiguration-core + ${project.parent.version} + compile + + + + + \ No newline at end of file diff --git a/impl/sql/src/main/java/cc/carm/lib/configuration/sql/SQLConfigProvider.java b/impl/sql/src/main/java/cc/carm/lib/configuration/sql/SQLConfigProvider.java new file mode 100644 index 0000000..eb391b8 --- /dev/null +++ b/impl/sql/src/main/java/cc/carm/lib/configuration/sql/SQLConfigProvider.java @@ -0,0 +1,55 @@ +package cc.carm.lib.configuration.sql; + +import cc.carm.lib.configuration.core.ConfigInitializer; +import cc.carm.lib.configuration.core.source.ConfigurationProvider; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.Unmodifiable; + +import java.util.List; + +public class SQLConfigProvider extends ConfigurationProvider { + + + @Override + public @NotNull SQLSectionWrapper getConfiguration() { + return null; + } + + @Override + public void save() throws Exception { + + } + + @Override + protected void onReload() throws Exception { + + } + + @Override + public void setHeaderComment(@Nullable String path, @Nullable List comments) { + + } + + @Override + public void setInlineComment(@NotNull String path, @Nullable String comment) { + + } + + @Override + public @Nullable @Unmodifiable List getHeaderComment(@Nullable String path) { + return null; + } + + @Override + public @Nullable String getInlineComment(@NotNull String path) { + return null; + } + + @Override + public @NotNull ConfigInitializer> getInitializer() { + return null; + } + + +} diff --git a/impl/sql/src/main/java/cc/carm/lib/configuration/sql/SQLSectionWrapper.java b/impl/sql/src/main/java/cc/carm/lib/configuration/sql/SQLSectionWrapper.java new file mode 100644 index 0000000..85fd6d5 --- /dev/null +++ b/impl/sql/src/main/java/cc/carm/lib/configuration/sql/SQLSectionWrapper.java @@ -0,0 +1,58 @@ +package cc.carm.lib.configuration.sql; + +import cc.carm.lib.configuration.core.source.ConfigurationWrapper; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class SQLSectionWrapper implements ConfigurationWrapper { + + @Override + public @NotNull Set getKeys(boolean deep) { + return null; + } + + @Override + public @NotNull Map getValues(boolean deep) { + return null; + } + + @Override + public void set(@NotNull String path, @Nullable Object value) { + + } + + @Override + public boolean contains(@NotNull String path) { + return false; + } + + @Override + public @Nullable Object get(@NotNull String path) { + return null; + } + + @Override + public boolean isList(@NotNull String path) { + return false; + } + + @Override + public @Nullable List getList(@NotNull String path) { + return null; + } + + @Override + public boolean isConfigurationSection(@NotNull String path) { + return false; + } + + @Override + public @Nullable ConfigurationWrapper getConfigurationSection(@NotNull String path) { + return null; + } + +} diff --git a/impl/sql/table_schem.sql b/impl/sql/table_schem.sql new file mode 100644 index 0000000..c2178fc --- /dev/null +++ b/impl/sql/table_schem.sql @@ -0,0 +1,13 @@ +CREATE TABLE IF NOT EXISTS conf +( + `namespace` VARCHAR(255) NOT NULL, # 记录配置文件的命名空间 + `section` VARCHAR(255) NOT NULL, # 记录配置文件数值的指定路径 + `type` VARCHAR(255) NOT NULL, + `value` LONGTEXT, # 记录该配置项的值 (可能为JSON格式) + `inline_comments` TEXT, # 记录配置文件的行内注释 + `header_comments` MEDIUMTEXT, # 记录配置文件的顶部注释 + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`namespace`, `section`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4; \ No newline at end of file diff --git a/pom.xml b/pom.xml index ed44964..08cde57 100644 --- a/pom.xml +++ b/pom.xml @@ -20,6 +20,7 @@ core impl/yaml impl/json + impl/sql EasyConfiguration