tempest-framework icon indicating copy to clipboard operation
tempest-framework copied to clipboard

[WIP] alter table

Open Treggats opened this issue 1 year ago • 6 comments

Currently a WIP pull request so I have a clear overview of the changes I have made so far

Treggats avatar Aug 16 '24 22:08 Treggats

Pull Request Test Coverage Report for Build 10479540308

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 79.642%

Totals Coverage Status
Change from base Build 10466756119: -0.3%
Covered Lines: 4268
Relevant Lines: 5359

💛 - Coveralls

coveralls avatar Aug 16 '24 22:08 coveralls

One point of feedback: I wouldn't test on the generated text. Rather I'd execute the query into a clean DB to make sure it actually works. It's a much more robust test that doesn't fail when we make formatting changes to our queries. Here's an example: https://github.com/tempestphp/tempest-framework/blob/query-statement-defaults/tests/Integration/Database/QueryStatements/CreateTableStatementTest.php

brendt avatar Aug 17 '24 06:08 brendt

One point of feedback: I wouldn't test on the generated text. Rather I'd execute the query into a clean DB to make sure it actually works.

Oh I like that, good idea

Treggats avatar Aug 17 '24 07:08 Treggats

One point of feedback: I wouldn't test on the generated text. Rather I'd execute the query into a clean DB to make sure it actually works. It's a much more robust test that doesn't fail when we make formatting changes to our queries. Here's an example: query-statement-defaults/tests/Integration/Database/QueryStatements/CreateTableStatementTest.php

@brendt just made a test like this, can't use the word table as table name 😋

Treggats avatar Aug 20 '24 14:08 Treggats

You can use table if you wrap it in backticks ;)

brendt avatar Aug 21 '24 12:08 brendt

You can use table if you wrap it in backticks ;)

True, 😅 though personally I'm not very fond of backticks in programming. I remember something about eval(..) in PHP 😋

Treggats avatar Aug 21 '24 12:08 Treggats

No but it should be within the compiled query, check out the CreateTableStatement where I added it as well ;)

brendt avatar Aug 22 '24 04:08 brendt

Gonna merge this one in a separate branch and work on a bit more

brendt avatar Aug 28 '24 10:08 brendt