-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: EXPOSED-419 Rework the getting started tutorial #2160
Conversation
docs/Map.jhm
Outdated
@@ -1 +1 @@ | |||
<?xml version='1.0' encoding='UTF-8'?><map version="2.0"><mapID target="Deep-Dive-into-DSL.md" url="deep-dive-into-dsl.html" default="no"/><mapID target="Frequently Asked Questions" url="frequently-asked-questions.html" default="no"/><mapID target="Deep-Dive-into-DSL" url="deep-dive-into-dsl.html" default="no"/><mapID target="Getting+Started+with+Exposed" url="getting-started-with-exposed.html" default="no"/><mapID target="Deep-Dive-into-DAO.md" url="deep-dive-into-dao.html" default="no"/><mapID target="Breaking+Changes" url="breaking-changes.html" default="no"/><mapID target="Breaking-Changes.md" url="breaking-changes.html" default="no"/><mapID target="Breaking-Changes" url="breaking-changes.html" default="no"/><mapID target="Exposed Documentation" url="home.html" default="no"/><mapID target="SQL-Functions" url="sql-functions.html" default="no"/><mapID target="Deep+Dive+into+DAO" url="deep-dive-into-dao.html" default="no"/><mapID target="Frequently+Asked+Questions" url="frequently-asked-questions.html" default="no"/><mapID target="Home.topic" url="home.html" default="yes"/><mapID target="SQL+Functions" url="sql-functions.html" default="no"/><mapID target="Breaking Changes" url="breaking-changes.html" default="no"/><mapID target="Deep Dive into DAO" url="deep-dive-into-dao.html" default="no"/><mapID target="Migration-Guide.md" url="migration-guide.html" default="no"/><mapID target="Exposed Modules" url="exposed-modules.html" default="no"/><mapID target="Data Types" url="data-types.html" default="no"/><mapID target="Transactions" url="transactions.html" default="no"/><mapID target="Data+Types" url="data-types.html" default="no"/><mapID target="Samples" url="samples.html" default="no"/><mapID target="Exposed-Modules.md" url="exposed-modules.html" default="no"/><mapID target="Database-and-DataSource.md" url="database-and-datasource.html" default="no"/><mapID target="Exposed+Documentation" url="home.html" default="no"/><mapID target="Migration-Guide" url="migration-guide.html" default="no"/><mapID target="Exposed-Modules" url="exposed-modules.html" default="no"/><mapID target="Data-Types" url="data-types.html" default="no"/><mapID target="Frequently-Asked-Questions" url="frequently-asked-questions.html" default="no"/><mapID target="Getting Started with Exposed" url="getting-started-with-exposed.html" default="no"/><mapID target="Deep+Dive+into+DSL" url="deep-dive-into-dsl.html" default="no"/><mapID target="Contributing" url="contributing.html" default="no"/><mapID target="Exposed+Modules" url="exposed-modules.html" default="no"/><mapID target="Contributing to Exposed" url="contributing.html" default="no"/><mapID target="Contributing.md" url="contributing.html" default="no"/><mapID target="Database-and-DataSource" url="database-and-datasource.html" default="no"/><mapID target="Deep-Dive-into-DAO" url="deep-dive-into-dao.html" default="no"/><mapID target="Transactions.md" url="transactions.html" default="no"/><mapID target="Deep Dive into DSL" url="deep-dive-into-dsl.html" default="no"/><mapID target="Samples.md" url="samples.html" default="no"/><mapID target="Getting-Started-with-Exposed.md" url="getting-started-with-exposed.html" default="no"/><mapID target="Working+with+Database+and+DataSource" url="database-and-datasource.html" default="no"/><mapID target="Home" url="home.html" default="yes"/><mapID target="SQL Functions" url="sql-functions.html" default="no"/><mapID target="Data-Types.md" url="data-types.html" default="no"/><mapID target="Migration+Guide" url="migration-guide.html" default="no"/><mapID target="Working with Database and DataSource" url="database-and-datasource.html" default="no"/><mapID target="Contributing+to+Exposed" url="contributing.html" default="no"/><mapID target="SQL-Functions.md" url="sql-functions.html" default="no"/><mapID target="Getting-Started-with-Exposed" url="getting-started-with-exposed.html" default="no"/><mapID target="-of4r3s_1_json" url="starting-page-Home.json" default="no"/><mapID target="Frequently-Asked-Questions.md" url="frequently-asked-questions.html" default="no"/><mapID target="Migration Guide" url="migration-guide.html" default="no"/></map> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it intended? I expect it would be regenerated after the next CI run.
The whole directory docs
is regenerated on every release (except files logo-dark.png
, logo-light.png
, site.webmanifest
inside)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it was automatically updated with the conversion of Getting-Started-with-Exposed.md
to a .topic
file. Should I exclude this and any changes of the docs
folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, files from generated folders will be dropped and regenerated anyway. I would exclude them from the PR to make it easy to read
e199fbd
to
470d95d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
I'm not sure about the docs
folder and the failing detekt check is also odd, as I thought we were filtering out sample files (maybe detekt.yml diff needs to be updated).
documentation-website/Writerside/snippets/get-started-with-exposed/app/build.gradle.kts
Outdated
Show resolved
Hide resolved
import org.jetbrains.exposed.sql.transactions.transaction | ||
|
||
fun main() { | ||
Database.connect("jdbc:h2:mem:test", driver = "org.h2.Driver") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following comment is most likely outside the scope of this tutorial, since it's a single transaction app. So feel free to ignore, I'm just mentioning this since users can download this sample and potentially try to take it further.
If a second transaction is opened after the first (to play more with the remaining task for example), the user may be surprised that the table and its data has been lost even though the app hasn't stopped. This is normal H2 behavior between connections/transactions (better explained here) and the solution is to use the url jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
.
I don't see this as a large issue, I'm just putting it out there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I think this could be useful, so I added is as a side note before the "Next steps" section.
@bog-walk, I don't see any errors in the detekt output. Could you tell me if we need to exclude docs from the detekt check? |
|
||
class AppTest { | ||
@Test fun appHasAGreeting() { | ||
// val classUnderTest = App() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this test could be removed. Was it generated automaticaly with the module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it was auto-generated.
@@ -0,0 +1,5 @@ | |||
# Ignore Gradle project-specific cache directory | |||
.gradle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we have no similar .gitignore
files in many other modules. I expect that .gradle
and build
directories should be excluded by root .gitignore
file (better to check).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems so! I removed it now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vnikolova It seems my most recent docs PR introduced some conflicts to resolve on rebase. Also, the output logs of the failing detekt task are not making the culprit issues very clear, so I copied and ran the app files in a local task and these are the issues it gave me:
- App.kt
- App.kt:19:27: Unexpected spacing before "(" [SpacingAroundParens]
- App.kt:17:9: Missing space after // [CommentSpacing]
- App.kt:38:9: Missing space after // [CommentSpacing]
- App.kt:47:9: Missing space after // [CommentSpacing]
- App.kt:34:93: Missing spacing before "{" [SpacingAroundCurly]
- Task.kt
- File 'Task.kt' contains a single top level declaration and should be named 'Tasks.kt' [Filename]
- Task.kt:7:15: Unnecessary long whitespace [NoMultipleSpaces]
- Task.kt:8:21: Unnecessary long whitespace [NoMultipleSpaces]
- Task.kt:7:34: This expression contains a magic number. Consider defining it to a well named constant. [MagicNumber]
- Task.kt:8:47: This expression contains a magic number. Consider defining it to a well named constant. [MagicNumber]
- AppTest.kt
- Unused imports
- Unnecessary block ("{}") [NoEmptyClassBody]
I'd suggest addressing as many as are easily possible and with that I'm hopeful the detekt task will pass so you can merge.
…add sample project
c208fb4
to
74a449c
Compare
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.jetbrains.exposed:exposed-jdbc](https://github.com/JetBrains/Exposed) | `0.52.0` -> `0.53.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.jetbrains.exposed:exposed-jdbc/0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.jetbrains.exposed:exposed-jdbc/0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.jetbrains.exposed:exposed-jdbc/0.52.0/0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.jetbrains.exposed:exposed-jdbc/0.52.0/0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [org.jetbrains.exposed:exposed-core](https://github.com/JetBrains/Exposed) | `0.52.0` -> `0.53.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.jetbrains.exposed:exposed-core/0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.jetbrains.exposed:exposed-core/0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.jetbrains.exposed:exposed-core/0.52.0/0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.jetbrains.exposed:exposed-core/0.52.0/0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>JetBrains/Exposed (org.jetbrains.exposed:exposed-jdbc)</summary> ### [`v0.53.0`](https://github.com/JetBrains/Exposed/blob/HEAD/CHANGELOG.md#0530) [Compare Source](https://github.com/JetBrains/Exposed/compare/0.52.0...0.53.0) Infrastructure: - SQLite driver 3.46.0.1 - Spring Framework 6.1.11 - Spring Boot 3.3.2 - junit-bom 5.10.3 Features: - feat: Add time extension function for temporal expressions in Kotlin and Java by [@​joc-a](https://github.com/joc-a) in [https://github.com/JetBrains/Exposed/pull/2121](https://github.com/JetBrains/Exposed/pull/2121) - feat: EXPOSED-435 Allow insertReturning() to set isIgnore = true by [@​bog-walk](https://github.com/bog-walk) in [https://github.com/JetBrains/Exposed/pull/2148](https://github.com/JetBrains/Exposed/pull/2148) - feat: EXPOSED-77 Support entity class for table with composite primary key by [@​bog-walk](https://github.com/bog-walk) in [https://github.com/JetBrains/Exposed/pull/1987](https://github.com/JetBrains/Exposed/pull/1987) - feat: EXPOSED-446 Support N-column inList equality comparisons by [@​bog-walk](https://github.com/bog-walk) in [https://github.com/JetBrains/Exposed/pull/2157](https://github.com/JetBrains/Exposed/pull/2157) - feat: EXPOSED-450 Merge command: PostgreSQL improvements by [@​obabichevjb](https://github.com/obabichevjb) in [https://github.com/JetBrains/Exposed/pull/2161](https://github.com/JetBrains/Exposed/pull/2161) - feat: EXPOSED-388 Support for column type converters by [@​obabichevjb](https://github.com/obabichevjb) in [https://github.com/JetBrains/Exposed/pull/2143](https://github.com/JetBrains/Exposed/pull/2143) - Adding comment text for a query SQL by [@​xJoeWoo](https://github.com/xJoeWoo) in [https://github.com/JetBrains/Exposed/pull/2088](https://github.com/JetBrains/Exposed/pull/2088) - feat: EXPOSED-459 Open AbstractQuery.copyTo() to allow custom Query class extension by [@​bog-walk](https://github.com/bog-walk) in [https://github.com/JetBrains/Exposed/pull/2173](https://github.com/JetBrains/Exposed/pull/2173) - feat: EXPOSED-461 Add time column in Joda-Time module by [@​joc-a](https://github.com/joc-a) in [https://github.com/JetBrains/Exposed/pull/2175](https://github.com/JetBrains/Exposed/pull/2175) Bug fixes: - fix: EXPOSED-424 ClassCastException exception when using `fetchBatchedResults` with `alias` by [@​joc-a](https://github.com/joc-a) in [https://github.com/JetBrains/Exposed/pull/2140](https://github.com/JetBrains/Exposed/pull/2140) - fix: EXPOSED-407 compositeMoney() nullability definition issues by [@​bog-walk](https://github.com/bog-walk) in [https://github.com/JetBrains/Exposed/pull/2137](https://github.com/JetBrains/Exposed/pull/2137) - fix: EXPOSED-415 SchemaUtils incorrectly generates ALTER statements for existing nullable columns by [@​obabichevjb](https://github.com/obabichevjb) in [https://github.com/JetBrains/Exposed/pull/2136](https://github.com/JetBrains/Exposed/pull/2136) - fix: EXPOSED-363 LocalTime and literal(LocalTime) are not the same by [@​joc-a](https://github.com/joc-a) in [https://github.com/JetBrains/Exposed/pull/2152](https://github.com/JetBrains/Exposed/pull/2152) - fix: EXPOSED-432 CurrentDate default is generated as null in MariaDB by [@​joc-a](https://github.com/joc-a) in [https://github.com/JetBrains/Exposed/pull/2149](https://github.com/JetBrains/Exposed/pull/2149) - fix: Allow column reference in default expressions for MySQL and MariaDB by [@​joc-a](https://github.com/joc-a) in [https://github.com/JetBrains/Exposed/pull/2159](https://github.com/JetBrains/Exposed/pull/2159) - fix: EXPOSED-430 Insert and BatchInsert do not return default values by [@​obabichevjb](https://github.com/obabichevjb) in [https://github.com/JetBrains/Exposed/pull/2158](https://github.com/JetBrains/Exposed/pull/2158) - fix: EXPOSED-452 Flaky H2\_Oracle test `testTimestampWithTimeZoneDefaults` by [@​joc-a](https://github.com/joc-a) in [https://github.com/JetBrains/Exposed/pull/2169](https://github.com/JetBrains/Exposed/pull/2169) - EXPOSED-457 The column default value always compares unequal by [@​obabichevjb](https://github.com/obabichevjb) in [https://github.com/JetBrains/Exposed/pull/2170](https://github.com/JetBrains/Exposed/pull/2170) - EXPOSED-409 Custom primary key. Access to the primary key fails with ClassCastException by [@​obabichevjb](https://github.com/obabichevjb) in [https://github.com/JetBrains/Exposed/pull/2151](https://github.com/JetBrains/Exposed/pull/2151) - fix: EXPOSED-447 Eager loading does not work with composite PK entity by [@​bog-walk](https://github.com/bog-walk) in [https://github.com/JetBrains/Exposed/pull/2177](https://github.com/JetBrains/Exposed/pull/2177) Docs: - chore: Add migration sample by [@​joc-a](https://github.com/joc-a) in [https://github.com/JetBrains/Exposed/pull/2144](https://github.com/JetBrains/Exposed/pull/2144) - docs: Change repetitionAttempts to maxAttempts in website docs by [@​bog-walk](https://github.com/bog-walk) in [https://github.com/JetBrains/Exposed/pull/2164](https://github.com/JetBrains/Exposed/pull/2164) - docs: EXPOSED-445 Add documentation for DSL & DAO composite primary keys by [@​bog-walk](https://github.com/bog-walk) in [https://github.com/JetBrains/Exposed/pull/2165](https://github.com/JetBrains/Exposed/pull/2165) - docs: EXPOSED-419 Rework the getting started tutorial by [@​vnikolova](https://github.com/vnikolova) in [https://github.com/JetBrains/Exposed/pull/2160](https://github.com/JetBrains/Exposed/pull/2160) - Configure API documentation for Exposed by [@​e5l](https://github.com/e5l) in [https://github.com/JetBrains/Exposed/pull/2171](https://github.com/JetBrains/Exposed/pull/2171) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/DonRobo/home-former). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
EXPOSED-419
Get started with Exposed
tutorial with new content.md
to.topic