Rate This Document
Findability
Accuracy
Completeness
Readability

Source Code SQL APIs

Basic SQL Extension API

  • API name: SqlBaseService
  • Function description: Provides basic methods for assessing and converting extended SQL statements.
  • Method detail: getSupportedDatasource
    • Function description: Provides the migration paths supported by the implementation class, including the source and target databases.
    • Return value: A DataSource entity class.
      Table 1 Fields of the DataSource class

      Field

      Type

      Description

      sourceDataSource

      String

      Source database. You are advised to enter an official name.

      targetDataSource

      String

      Target database. You are advised to enter an official name.

Extended Conversion API

  • API name: ConvertService
  • Function description: Provides basic conversion.
  • Method detail: convert
    • Function description: Converts SQL statements.
    • Parameter

      sql: SQL statement to be converted.

    • Return value: A BaseConvertResult entity class.
      Table 2 Fields of the BaseConvertResult class

      Field

      Type

      Description

      sourceSql

      String

      SQL statement before conversion.

      targetSql

      String

      SQL statement after conversion.

      convertStatus

      int

      SQL conversion status.

      • 0 (default): success
      • 1: success, but a suggestion is required
      • 2: not supported

      convertSource

      int

      Origin of SQL statement conversion:

      • 0: built-in
      • 1 (default): extended package

      suggestions

      List

      SQL conversion suggestion.

      Table 3 Fields of the Suggestion class

      Field

      Type

      Description

      isDisplay

      boolean

      Indicates whether to display the suggestion. The default value is true.

      suggestionCn

      String

      Suggestion in Chinese.

      suggestionEn

      String

      Suggestion in English.