Skip to content

chore: init go workspace#8163

Merged
fulghum merged 6 commits intodolthub:mainfrom
laciferin2024:chore/workspace
Aug 1, 2024
Merged

chore: init go workspace#8163
fulghum merged 6 commits intodolthub:mainfrom
laciferin2024:chore/workspace

Conversation

@laciferin2024
Copy link
Copy Markdown
Contributor

@laciferin2024 laciferin2024 commented Jul 26, 2024

  • migrate local replace directives to go.work as per go1.18+ standards

@fulghum
Copy link
Copy Markdown
Contributor

fulghum commented Jul 31, 2024

Hi @laciferin2024, thank you for sending us this contribution! 🙏

It looks like the project doesn't compile after these changes. I'm not an expert on the new go.work file format, but the CI checks are failing to build with this error:
pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies

Would you be able to take a pass on what's missing in the project config to keep those checks passing?

laciferin2024 and others added 2 commits July 31, 2024 22:37
Co-authored-by: Jason Fulghum <jason.fulghum@gmail.com>
@laciferin2024
Copy link
Copy Markdown
Contributor Author

@fulghum tests are passing now:

...
=== RUN   TestSqlSelect/select_*_from_people_where_25_=_age
+--------------------------------------+--------------+-----+------------+-------+
| id                                   | name         | age | is_married | title |
+--------------------------------------+--------------+-----+------------+-------+
| 00000000-0000-0000-0000-000000000001 | John Johnson | 25  | 0          | Dufus |
+--------------------------------------+--------------+-----+------------+-------+

=== RUN   TestSqlSelect/select_*_from_people_where_is_married_=_false
+--------------------------------------+---------------+-----+------------+-------+
| id                                   | name          | age | is_married | title |
+--------------------------------------+---------------+-----+------------+-------+
| 00000000-0000-0000-0000-000000000001 | John Johnson  | 25  | 0          | Dufus |
| 00000000-0000-0000-0000-000000000002 | Rob Robertson | 21  | 0          |       |
+--------------------------------------+---------------+-----+------------+-------+

=== RUN   TestSqlSelect/select_*_from_people_where_age_<_30
+--------------------------------------+---------------+-----+------------+-------+
| id                                   | name          | age | is_married | title |
+--------------------------------------+---------------+-----+------------+-------+
| 00000000-0000-0000-0000-000000000001 | John Johnson  | 25  | 0          | Dufus |
| 00000000-0000-0000-0000-000000000002 | Rob Robertson | 21  | 0          |       |
+--------------------------------------+---------------+-----+------------+-------+

=== RUN   TestSqlSelect/select_*_from_people_where_age_>_24
+--------------------------------------+----------------+-----+------------+--------------+
| id                                   | name           | age | is_married | title        |
+--------------------------------------+----------------+-----+------------+--------------+
| 00000000-0000-0000-0000-000000000000 | Bill Billerson | 32  | 1          | Senior Dufus |
| 00000000-0000-0000-0000-000000000001 | John Johnson   | 25  | 0          | Dufus        |
+--------------------------------------+----------------+-----+------------+--------------+

=== RUN   TestSqlSelect/select_*_from_people_where_age_>=_25
+--------------------------------------+----------------+-----+------------+--------------+
| id                                   | name           | age | is_married | title        |
+--------------------------------------+----------------+-----+------------+--------------+
| 00000000-0000-0000-0000-000000000000 | Bill Billerson | 32  | 1          | Senior Dufus |
| 00000000-0000-0000-0000-000000000001 | John Johnson   | 25  | 0          | Dufus        |
+--------------------------------------+----------------+-----+------------+--------------+

=== RUN   TestSqlSelect/select_*_from_people_where_name_<=_'John_Johnson'
+--------------------------------------+----------------+-----+------------+--------------+
| id                                   | name           | age | is_married | title        |
+--------------------------------------+----------------+-----+------------+--------------+
| 00000000-0000-0000-0000-000000000000 | Bill Billerson | 32  | 1          | Senior Dufus |
| 00000000-0000-0000-0000-000000000001 | John Johnson   | 25  | 0          | Dufus        |
+--------------------------------------+----------------+-----+------------+--------------+

=== RUN   TestSqlSelect/select_*_from_people_where_name_<>_'John_Johnson'
+--------------------------------------+----------------+-----+------------+--------------+
| id                                   | name           | age | is_married | title        |
+--------------------------------------+----------------+-----+------------+--------------+
| 00000000-0000-0000-0000-000000000000 | Bill Billerson | 32  | 1          | Senior Dufus |
| 00000000-0000-0000-0000-000000000002 | Rob Robertson  | 21  | 0          |              |
+--------------------------------------+----------------+-----+------------+--------------+

=== RUN   TestSqlSelect/select_age,_is_married_from_people_where_name_<>_'John_Johnson'
+-----+------------+
| age | is_married |
+-----+------------+
| 32  | 1          |
| 21  | 0          |
+-----+------------+

=== RUN   TestSqlSelect/select_age,_is_married_from_people_where_name_<>_'John_Johnson'_limit_1
+-----+------------+
| age | is_married |
+-----+------------+
| 32  | 1          |
+-----+------------+

--- PASS: TestSqlSelect (0.22s)
    --- PASS: TestSqlSelect/select_*_from_doesnt_exist_where_age_=_32 (0.01s)
    --- PASS: TestSqlSelect/select_*_from_people (0.02s)
    --- PASS: TestSqlSelect/select_*_from_people_where_age_=_32 (0.02s)
    --- PASS: TestSqlSelect/select_*_from_people_where_title_=_'Senior_Dufus' (0.01s)
    --- PASS: TestSqlSelect/select_*_from_people_where_name_=_'Bill_Billerson' (0.01s)
    --- PASS: TestSqlSelect/select_*_from_people_where_name_=_'John_Johnson' (0.04s)
    --- PASS: TestSqlSelect/select_*_from_people_where_age_=_25 (0.01s)
    --- PASS: TestSqlSelect/select_*_from_people_where_25_=_age (0.01s)
    --- PASS: TestSqlSelect/select_*_from_people_where_is_married_=_false (0.01s)
    --- PASS: TestSqlSelect/select_*_from_people_where_age_<_30 (0.01s)
    --- PASS: TestSqlSelect/select_*_from_people_where_age_>_24 (0.01s)
    --- PASS: TestSqlSelect/select_*_from_people_where_age_>=_25 (0.01s)
    --- PASS: TestSqlSelect/select_*_from_people_where_name_<=_'John_Johnson' (0.03s)
    --- PASS: TestSqlSelect/select_*_from_people_where_name_<>_'John_Johnson' (0.02s)
    --- PASS: TestSqlSelect/select_age,_is_married_from_people_where_name_<>_'John_Johnson' (0.01s)
    --- PASS: TestSqlSelect/select_age,_is_married_from_people_where_name_<>_'John_Johnson'_limit_1 (0.01s)
=== RUN   TestSqlShow
=== RUN   TestSqlShow/show_tables
+----------------+
| Tables_in_dolt |
+----------------+
| people         |
+----------------+

=== RUN   TestSqlShow/show_create_table_people
+--------+------------------------------------------------------------------+
| Table  | Create Table                                                     |
+--------+------------------------------------------------------------------+
| people | CREATE TABLE `people` (                                          |
|        |   `id` varchar(36) NOT NULL,                                     |
|        |   `name` varchar(40) NOT NULL,                                   |
|        |   `age` int unsigned,                                            |
|        |   `is_married` int,                                              |
|        |   `title` varchar(40),                                           |
|        |   PRIMARY KEY (`id`),                                            |
|        |   KEY `idx_name` (`name`)                                        |
|        | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin |
+--------+------------------------------------------------------------------+

=== RUN   TestSqlShow/show_all_tables
error on line 1 for query show all tables
Error parsing SQL: 
syntax error at position 9 near 'all'
show all tables
         ^
--- PASS: TestSqlShow (0.11s)
    --- PASS: TestSqlShow/show_tables (0.05s)
    --- PASS: TestSqlShow/show_create_table_people (0.01s)
    --- PASS: TestSqlShow/show_all_tables (0.04s)
=== RUN   TestCreateTable
=== RUN   TestCreateTable/create_table
error on line 1 for query create table
Error parsing SQL: 
syntax error at position 13 near 'table'
create table
             ^
=== RUN   TestCreateTable/create_table_(id_int_
error on line 1 for query create table (id int 
Error parsing SQL: 
syntax error at position 15 near 'table'
create table (id int 
               ^
=== RUN   TestCreateTable/create_table_people_(id_int_primary_key)
=== RUN   TestCreateTable/create_table_people_(id_int_primary_key,_age_int)
=== RUN   TestCreateTable/create_table_people_(id_int_primary_key,_age_int,_first_name_varchar(80),_is_married_bit)
=== RUN   TestCreateTable/create_table_people_(`id`_int,_`age`_int,_`first_name`_varchar(80),_`last_name`_varchar(80),_`title`_varchar(80),_`is_married`_bit,_primary_key_(`id`,_`age`))
--- PASS: TestCreateTable (0.11s)
    --- PASS: TestCreateTable/create_table (0.00s)
    --- PASS: TestCreateTable/create_table_(id_int_ (0.02s)
    --- PASS: TestCreateTable/create_table_people_(id_int_primary_key) (0.02s)
    --- PASS: TestCreateTable/create_table_people_(id_int_primary_key,_age_int) (0.02s)
    --- PASS: TestCreateTable/create_table_people_(id_int_primary_key,_age_int,_first_name_varchar(80),_is_married_bit) (0.01s)
    --- PASS: TestCreateTable/create_table_people_(`id`_int,_`age`_int,_`first_name`_varchar(80),_`last_name`_varchar(80),_`title`_varchar(80),_`is_married`_bit,_primary_key_(`id`,_`age`)) (0.02s)
=== RUN   TestShowTables
=== RUN   TestShowTables/show_
error on line 1 for query show 
Error parsing SQL: 
syntax error at position 6 near 'show'
show 
      ^
=== RUN   TestShowTables/show_table
error on line 1 for query show table
Error parsing SQL: 
syntax error at position 11 near 'table'
show table
           ^
=== RUN   TestShowTables/show_tables
+----------------+
| Tables_in_dolt |
+----------------+
| people         |
+----------------+

=== RUN   TestShowTables/show_create_table_people
+--------+------------------------------------------------------------------+
| Table  | Create Table                                                     |
+--------+------------------------------------------------------------------+
| people | CREATE TABLE `people` (                                          |
|        |   `id` varchar(36) NOT NULL,                                     |
|        |   `name` varchar(40) NOT NULL,                                   |
|        |   `age` int unsigned,                                            |
|        |   `is_married` int,                                              |
|        |   `title` varchar(40),                                           |
|        |   PRIMARY KEY (`id`),                                            |
|        |   KEY `idx_name` (`name`)                                        |
|        | ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin |
+--------+------------------------------------------------------------------+

=== RUN   TestShowTables/show_create_table_dne
error on line 1 for query show create table dne: table not found: dne
--- PASS: TestShowTables (0.09s)
    --- PASS: TestShowTables/show_ (0.02s)
    --- PASS: TestShowTables/show_table (0.01s)
    --- PASS: TestShowTables/show_tables (0.02s)
    --- PASS: TestShowTables/show_create_table_people (0.03s)
    --- PASS: TestShowTables/show_create_table_dne (0.01s)
=== RUN   TestAlterTable
=== RUN   TestAlterTable/alter_table
error on line 1 for query alter table
Error parsing SQL: 
syntax error at position 12 near 'table'
alter table
            ^
=== RUN   TestAlterTable/alter_table_people_rename
error on line 1 for query alter table people rename
Error parsing SQL: 
syntax error at position 26 near 'rename'
alter table people rename
                          ^
=== RUN   TestAlterTable/alter_table_dne_rename_column_id_to_newId
error on line 1 for query alter table dne rename column id to newId: table not found: dne
=== RUN   TestAlterTable/alter_table_people_rename_column_name_to_appelation
=== RUN   TestAlterTable/alter_table_people_rename_to_newPeople
=== RUN   TestAlterTable/rename_table_people_to_newPeople
=== RUN   TestAlterTable/alter_table_people_add_column_(newCol_int_not_null_default_10)
=== RUN   TestAlterTable/alter_table_people_drop_column_title
--- PASS: TestAlterTable (0.14s)
    --- PASS: TestAlterTable/alter_table (0.01s)
    --- PASS: TestAlterTable/alter_table_people_rename (0.01s)
    --- PASS: TestAlterTable/alter_table_dne_rename_column_id_to_newId (0.01s)
    --- PASS: TestAlterTable/alter_table_people_rename_column_name_to_appelation (0.02s)
    --- PASS: TestAlterTable/alter_table_people_rename_to_newPeople (0.05s)
    --- PASS: TestAlterTable/rename_table_people_to_newPeople (0.02s)
    --- PASS: TestAlterTable/alter_table_people_add_column_(newCol_int_not_null_default_10) (0.01s)
    --- PASS: TestAlterTable/alter_table_people_drop_column_title (0.01s)
=== RUN   TestDropTable
=== RUN   TestDropTable/drop_table
error on line 1 for query drop table
Error parsing SQL: 
syntax error at position 11 near 'table'
drop table
           ^
=== RUN   TestDropTable/drop_table_people
=== RUN   TestDropTable/drop_table_dne
error on line 1 for query drop table dne: table not found: dne
=== RUN   TestDropTable/drop_table_if_exists_dne
--- PASS: TestDropTable (0.08s)
    --- PASS: TestDropTable/drop_table (0.02s)
    --- PASS: TestDropTable/drop_table_people (0.04s)
    --- PASS: TestDropTable/drop_table_dne (0.01s)
    --- PASS: TestDropTable/drop_table_if_exists_dne (0.01s)
=== RUN   TestInsert
=== RUN   TestInsert/no_primary_key
error on line 1 for query insert into people (title) values ('hello'): Field 'id' doesn't have a default value
=== RUN   TestInsert/bad_syntax
error on line 1 for query insert into table
Error parsing SQL: 
syntax error at position 18 near 'table'
insert into table
                  ^
=== RUN   TestInsert/bad_syntax#01
error on line 1 for query insert into people (id) values
Error parsing SQL: 
syntax error at position 31 near 'values'
insert into people (id) values
                               ^
=== RUN   TestInsert/table_doesn't_exist
error on line 1 for query insert into dne (id) values (00000000-0000-0000-0000-000000000005): table not found: dne
=== RUN   TestInsert/insert_one_row
Query OK, 1 row affected (0.00 sec)
=== RUN   TestInsert/includes_functions
Query OK, 1 row affected (0.00 sec)
=== RUN   TestInsert/no_column_names
Query OK, 1 row affected (0.00 sec)
=== RUN   TestInsert/insert_one_row_all_columns
Query OK, 1 row affected (0.00 sec)
=== RUN   TestInsert/insert_two_rows_all_columns
Query OK, 2 rows affected (0.00 sec)
=== RUN   TestInsert/mixed_order
Query OK, 1 row affected (0.00 sec)
=== RUN   TestInsert/too_many_values
error on line 1 for query insert into people (name, id, age, is_married) values
				('FirsNam LasNam', '00000000-0000-0000-0000-000000000005', 33, false, 'Super-Resident'): number of values does not match number of columns provided
=== RUN   TestInsert/not_enough_values
error on line 1 for query insert into people (name, id, age, is_married, title) values
				('FirsNam LasNam', '00000000-0000-0000-0000-000000000005', 33, false): number of values does not match number of columns provided
=== RUN   TestInsert/missing_required_column
error on line 1 for query insert into people (id, title, age) values
				('00000000-0000-0000-0000-000000000005', 'Frank Frankerson', 10): Field 'name' doesn't have a default value
=== RUN   TestInsert/existing_primary_key
error on line 1 for query insert into people (id, name, age, is_married, title) values
				('00000000-0000-0000-0000-000000000000', 'Frank Frankerson', 10, false, 'Goon'): duplicate primary key given: [00000000-0000-0000-0000-000000000000]
--- PASS: TestInsert (0.19s)
    --- PASS: TestInsert/no_primary_key (0.01s)
    --- PASS: TestInsert/bad_syntax (0.01s)
    --- PASS: TestInsert/bad_syntax#01 (0.02s)
    --- PASS: TestInsert/table_doesn't_exist (0.01s)
    --- PASS: TestInsert/insert_one_row (0.01s)
    --- PASS: TestInsert/includes_functions (0.01s)
    --- PASS: TestInsert/no_column_names (0.03s)
    --- PASS: TestInsert/insert_one_row_all_columns (0.01s)
    --- PASS: TestInsert/insert_two_rows_all_columns (0.01s)
    --- PASS: TestInsert/mixed_order (0.02s)
    --- PASS: TestInsert/too_many_values (0.01s)
    --- PASS: TestInsert/not_enough_values (0.01s)
    --- PASS: TestInsert/missing_required_column (0.01s)
    --- PASS: TestInsert/existing_primary_key (0.02s)
=== RUN   TestUpdate
=== RUN   TestUpdate/update_table
error on line 1 for query update table
Error parsing SQL: 
syntax error at position 13 near 'table'
update table
             ^
=== RUN   TestUpdate/update_people_set_id
error on line 1 for query update people set id
Error parsing SQL: 
syntax error at position 21 near 'id'
update people set id
                     ^
=== RUN   TestUpdate/update_dne_set_id_=_'00000000-0000-0000-0000-000000000005'
error on line 1 for query update dne set id = '00000000-0000-0000-0000-000000000005': table not found: dne
=== RUN   TestUpdate/update_people_set_age_=_1_where_id_=_'00000000-0000-0000-0000-000000000002'
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0
=== RUN   TestUpdate/update_people_set_age_=_1,_is_married_=_true_where_age_>_21
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0
=== RUN   TestUpdate/update_people_set_name_=_null_where_id_='00000000-0000-0000-0000-000000000000'
error on line 1 for query update people set name = null where id ='00000000-0000-0000-0000-000000000000': column name 'name' is non-nullable but attempted to set a value of null
--- PASS: TestUpdate (0.08s)
...

@laciferin2024
Copy link
Copy Markdown
Contributor Author

Full test summary::
out.txt

@fulghum
Copy link
Copy Markdown
Contributor

fulghum commented Aug 1, 2024

Thanks for the changes @laciferin2024. I'm pretty sure the three CI failures are because those checks don't run correctly for PR authors outside our group. I'll dig in and double check and give you an update later today.

@fulghum fulghum merged commit aab4f2c into dolthub:main Aug 1, 2024
@fulghum
Copy link
Copy Markdown
Contributor

fulghum commented Aug 1, 2024

Thanks for the contribution @laciferin2024! This has been merged into main now.

@laciferin2024
Copy link
Copy Markdown
Contributor Author

Thanks @fulghum , looking forward to contributing more down the road

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants