Skip to content

安装指南

本指南将详细介绍如何在不同环境中安装和配置 SuperSQL。

Maven 依赖

基础依赖

在你的 pom.xml 中添加 SuperSQL 核心依赖:

xml
<dependency>
    <groupId>com.aispace.supersql</groupId>
    <artifactId>super-sql-spring-boot-starter</artifactId>
    <version>1.0.0-M1</version>
</dependency>

可选依赖

根据你的需求,可以添加以下可选依赖:

MyBatis Plus 集成

xml
<dependency>
    <groupId>com.aispace.supersql</groupId>
    <artifactId>super-sql-mybatis-plus</artifactId>
    <version>1.0.0-M1</version>
</dependency>

Azure OpenAI 模型

xml
<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-starter-model-azure-openai</artifactId>
</dependency>

Ollama 模型

xml
<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-starter-model-ollama</artifactIdkt>
</dependency>

Chroma 向量数据库

xml
<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-starter-vector-store-chroma</artifactId>
</dependency>

Gradle 依赖

基础依赖

在你的 build.gradle 中添加:

groovy
implementation 'com.aispace.supersql:super-sql-spring-boot-starter:1.0.0-M1'

可选依赖

groovy
// MyBatis Plus 集成
implementation 'com.aispace.supersql:super-sql-mybatis-plus:1.0.0-M1'

// Azure OpenAI 模型
implementation 'org.springframework.ai:spring-ai-starter-model-azure-openai'

// Ollama 模型
implementation 'org.springframework.ai:spring-ai-starter-model-ollama'

// Chroma 向量数据库
implementation 'org.springframework.ai:spring-ai-starter-vector-store-chroma'

系统要求

Java 版本

  • 最低版本: JDK 21
  • 推荐版本: JDK 21 或更高

Spring Boot 版本

  • 最低版本: 3.4.4
  • 推荐版本: 3.4.4 或更高

数据库支持

SuperSQL 支持以下数据库:

  • MySQL 8.0+
  • PostgreSQL 12+
  • Oracle 19c+
  • SQL Server 2019+
  • H2 2.0+

操作系统

  • Windows 10+
  • macOS 10.15+
  • Linux (主流发行版)

验证安装

安装完成后,你可以通过以下方式验证:

1. 检查依赖

运行 Maven 命令检查依赖:

bash
mvn dependency:tree

2. 启动应用

启动你的 Spring Boot 应用,检查日志中是否有 SuperSQL 相关的输出:

SuperSQL initialized successfully

3. 测试 API

创建一个简单的测试端点:

java
@RestController
public class HealthController {
    
    @GetMapping("/health")
    public String health() {
        return "SuperSQL is running!";
    }
}

访问 http://localhost:8080/health 验证应用是否正常运行。

常见安装问题

依赖冲突

如果遇到依赖冲突,可以尝试:

xml
<dependency>
    <groupId>com.aispace.supersql</groupId>
    <artifactId>super-sql-spring-boot-starter</artifactId>
    <version>1.0.0-M1</version>
    <exclusions>
        <exclusion>
            <groupId>conflicting-group</groupId>
            <artifactId>conflicting-artifact</artifactId>
        </exclusion>
    </exclusions>
</dependency>

版本不兼容

确保 Spring Boot 版本与 SuperSQL 兼容:

xml
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.4.4</version>
</parent>

网络问题

如果在国内网络环境下遇到下载问题,可以配置 Maven 镜像:

xml
<mirrors>
    <mirror>
        <id>aliyun</id>
        <mirrorOf>central</mirrorOf>
        <name>Aliyun Maven Mirror</name>
        <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
</mirrors>

下一步

安装完成后,你可以:

最近更新

基于 Apache 2.0 许可证发布