feat: add `DataType::Char` and add `LEN` to `Describe` by KKould · Pull Request #174 · KipData/KiteSQL

What problem does this PR solve?

let _ = fnck_sql
    .run("CREATE TABLE TABLE_E021_02_01_05 ( ID INT PRIMARY KEY, A CHAR ( 8 ) )")
    .await?;
let (schema, tuples) = fnck_sql.run("describe TABLE_E021_02_01_05").await?;
println!("{}", create_table(&schema, &tuples));
+-------+---------+-----+-------+---------+---------+
| FIELD | TYPE    | LEN | NULL  | Key     | DEFAULT |
+===================================================+
| id    | INTEGER | 4   | false | PRIMARY | null    |
|-------+---------+-----+-------+---------+---------|
| a     | CHAR    | 8   | true  | EMPTY   | null    |
+-------+---------+-----+-------+---------+---------+

on mysql

mysql> insert into T1 (A) VALUES('      abc   ');
Query OK, 1 row affected (0.00 sec)

mysql> select * from T1;
+-----------+
| A         |
+-----------+
| abc       |
|       abc |
+-----------+
2 rows in set (0.00 sec)

Issue link: #130

Code changes

  • Has Rust code change
  • Has CI related scripts change

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Note for reviewer