ppvan / psequel

Run your SQL query
https://flathub.org/vi/apps/me.ppvan.psequel
GNU General Public License v3.0
64 stars 1 forks source link

Migrate to go #86

Open ppvan opened 3 days ago

ppvan commented 3 days ago

In the end, I can't deal with fixing endless meson bug and binding C library. This issue list benefits and changes when migrate to Go:

Benefit:

Challeges

Work to do:

ppvan commented 2 days ago

Infomation schema implementation:

type InformationSchema struct {
    metadata.LoggingReader
    pf                  func(int) string
    hasFunctions        bool
    hasSequences        bool
    hasIndexes          bool
    hasConstraints      bool
    hasCheckConstraints bool
    hasTablePrivileges  bool
    hasColumnPrivileges bool
    hasUsagePrivileges  bool
    clauses             map[ClauseName]string
    limit               int
    systemSchemas       []string
    currentSchema       string
    dataTypeFormatter   func(metadata.Column) string
}
type Column struct {
    Catalog         string
    Schema          string
    Table           string
    Name            string
    OrdinalPosition int
    DataType        string
    // ScanType        reflect.Type
    Default         string
    ColumnSize      int
    DecimalDigits   int
    NumPrecRadix    int
    CharOctetLength int
    IsNullable      Bool
}
type Table struct {
    Catalog string
    Schema  string
    Name    string
    Type    string
    Rows    int64
    Size    string
    Comment string
}

type Constraint struct {
    Catalog string
    Schema  string
    Table   string
    Name    string
    Type    string

    IsDeferrable        Bool
    IsInitiallyDeferred Bool

    ForeignCatalog string
    ForeignSchema  string
    ForeignTable   string
    ForeignName    string
    MatchType      string
    UpdateRule     string
    DeleteRule     string

    CheckClause string
}