Skip to content

Commit 4ec11c9

Browse files
committed
Doc fixes, clean up cross-line single tick code snippets.
1 parent bfb0853 commit 4ec11c9

7 files changed

Lines changed: 55 additions & 91 deletions

File tree

DEVELOPER_README.md

Lines changed: 28 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ Notes for working on this repo.
55
## Prerequisites
66

77
- .NET SDK 10 or newer
8-
- PowerShell 5.1+ on Windows; PowerShell 7+ on Linux/macOS (install: <https://learn.microsoft.com/powershell/scripting/install/installing-powershell>). The build scripts (`build/pack-dev.ps1`, `build/pack-release.ps1`) are pwsh-only.
8+
- PowerShell 5.1+ on Windows; PowerShell 7+ on Linux/macOS (install: <https://learn.microsoft.com/powershell/scripting/install/installing-powershell>). The build scripts (`build/pack-dev.ps1`, `build/pack-release.ps1`) use PowerShell.
99

1010
## Repo layout assumption
1111

12-
The dev workflow assumes you have this repo cloned alongside its sibling
13-
repos (most importantly [Rezoom](https://github.com/rspeele/Rezoom)) under a
14-
common parent directory. The parent's name doesn't matter, but the
12+
The dev workflow assumes you have this repo cloned alongside its sibling repos (most importantly
13+
[Rezoom](https://github.com/rspeele/Rezoom)) under a common parent directory. The parent's name doesn't matter, but the
1514
siblings need to be together.
1615

1716
```
@@ -38,39 +37,22 @@ You need a `NuGet.config` at the parent level so package restore finds
3837
</configuration>
3938
```
4039

41-
If you're only working on Rezoom.SQL and don't need to iterate on Rezoom,
42-
you can use the latest published Rezoom from nuget.org. If you're changing
43-
both, pack Rezoom into the same `.localfeed` first using whatever script that
44-
repo provides.
40+
This allows pushing local "updates" to the NuGet packages so the TypeProviderUser tests can reference them just like a
41+
real downstream user.
4542

46-
## Why the unusual setup
47-
48-
Rezoom.SQL has two artifacts that interact awkwardly during dev:
49-
50-
- The **type provider** (`Rezoom.SQL.Provider`) is loaded by `fsc` at compile
51-
time, not at the consumer's runtime. To test a TP change, a project has to
52-
reference a NuGet-installed version of the provider, not a project-reference
53-
to its source. (Project references don't trigger the same TP loading path.)
54-
55-
- The **TP user smoke tests** (in `src/TypeProviderUsers/`) exercise the TP
56-
exactly the way a consumer would — they `PackageReference` the wrapper
57-
meta-packages (e.g. `Rezoom.SQL.Provider.SQLite`) which transitively bring
58-
in `Rezoom.SQL.Provider`. So testing a TP change means packing your changes,
59-
then letting the TPUs restore the new package and rebuild.
60-
61-
The local feed + version-bump dance encodes this. Run `build/pack-dev.ps1`
62-
after a Provider change; the TPUs (and any consumer in the repo) automatically
63-
restore the new version on their next build.
43+
If you're only working on Rezoom.SQL and don't need to make changes to Rezoom, you can use the latest published Rezoom
44+
from nuget.org. If you're changing both, pack Rezoom into the same `.localfeed` first using whatever script that repo
45+
provides.
6446

6547
## Versioning during dev
6648

67-
All Rezoom.SQL packages share a single version. Two files compose it:
49+
All Rezoom.SQL packages share a single version. Two files define it:
6850

6951
- `version.props` (committed): `RezoomSqlVersion = 0.13.0`, represents the upcoming or
7052
current release version. Bumped only at actual releases.
7153
- `version.local.props` (gitignored): written by `pack-dev.ps1`, contains
7254
`RezoomSqlVersionSuffix = dev.N`. The combined version becomes
73-
`0.13.0-dev.N`. Bumped extremely frequently during development, every time we have to smoke-test the TPUs.
55+
`0.13.0-dev.N`. Bumped extremely frequently during development, every time we have to "pack-dev.ps1" and smoke-test the TPUs.
7456

7557
Every package and consumer reads these via `Directory.Build.props`. Wrapper
7658
csprojs and TPU / demo fsprojs reference our packages as
@@ -81,85 +63,67 @@ release version automatically.
8163

8264
### `build/pack-dev.ps1`
8365

84-
Bumps the dev counter (one above the highest existing prerelease in the local
85-
feed), writes `version.local.props`, packs all six packages. Run after any
86-
change you want the TPUs or demos to see.
66+
Bumps the dev counter (one above the highest existing prerelease in the local feed), writes `version.local.props`, packs
67+
all six packages. Run after any change you want the TPUs or demos to see.
8768

8869
```powershell
8970
./build/pack-dev.ps1
9071
```
9172

9273
### `build/pack-release.ps1`
9374

94-
Deletes `version.local.props` so the build has no prerelease suffix, then
95-
packs all six packages at the release version. Errors out if the working
96-
tree is dirty (override with `-Force`). After it succeeds, tag and push:
75+
Deletes `version.local.props` so the build has no prerelease suffix, then packs all six packages at the release version.
76+
Errors out if the working tree is dirty (override with `-Force`). After it succeeds, tag and push:
9777

9878
```powershell
9979
./build/pack-release.ps1
10080
git tag v1.0.0
10181
git push origin v1.0.0
10282
```
10383

104-
Drop the `.nupkg`s into wherever your nuget.org push lives.
105-
10684
### `build/pack-parents.ps1`
10785

108-
Packs the three parent libs (FParsec-Pipes, LicenseToCIL, Rezoom) from
109-
their sibling repos at the versions declared in each fsproj. Use this when
110-
you've edited a parent and want Rezoom.SQL to pick up the fresh bits.
86+
Packs the three parent libs (FParsec-Pipes, LicenseToCIL, Rezoom) from their sibling repos at the versions declared in
87+
each fsproj. Use this when you've edited a parent and want Rezoom.SQL to pick up the new dev version.
11188

11289
```powershell
11390
./build/pack-parents.ps1 # all three
11491
./build/pack-parents.ps1 -Only Rezoom # one at a time
11592
```
11693

117-
The parents don't participate in the centralized `version.props` mechanism
118-
(they change rarely; their versions are bumped manually). If you're
119-
publishing parent changes, bump the parent's `<Version>` first, then run
120-
this script.
94+
The parents don't participate in the centralized `version.props` mechanism (they change rarely; their versions are
95+
bumped manually). If you're publishing parent changes, bump the parent's `<Version>` first, then run this script.
12196

12297
### `build/regen-doc-nav.ps1`
12398

124-
Rewrites the breadcrumb + prev/next nav blocks at the top and bottom of
125-
every doc page listed in `SUMMARY.md`. Run after editing `SUMMARY.md`
126-
(adding pages, reordering, renaming) to bring all nav links back into sync.
99+
Rewrites the breadcrumb + prev/next nav blocks at the top and bottom of every doc page listed in `SUMMARY.md`. Run after
100+
editing `SUMMARY.md` (adding pages, reordering, renaming) to bring all nav links back into sync.
127101

128102
```powershell
129103
./build/regen-doc-nav.ps1
130104
```
131105

132-
Each rewritten block is fenced by HTML comment markers (`<!-- nav-top -->` /
133-
`<!-- nav-bottom -->`) so the script can rerun cleanly.
134-
135106
### `src/TypeProviderUsers/test-tp-users.ps1`
136107

137108
Runs `dotnet test` on both TPU projects. SQLite can make its own DB file, but Postgres auto-
138109
skips when no server is reachable. Either set up your local Postgres like mine, with an
139110
`rz` user and password `testtest`, or use `REZOOM_TPU_POSTGRES` to override the
140111
connection string.
141112

142-
## Why the TPUs aren't in the main sln
143-
144-
The TPUs reference the wrapper packages via NuGet, not via project reference.
145-
Putting them in the same sln as `Rezoom.SQL.Provider` is confusing: opening
146-
the sln in VS suggests project-ref semantics, but the TPUs actually consume
147-
whatever's currently packed into `.localfeed`. Changing Provider source
148-
without running `pack-dev.ps1` would silently leave the TPUs on the old
149-
version.
113+
### `src/TypeProviderUsers/test-vs-build.ps1`
150114

151-
They live as standalone fsprojs under `src/TypeProviderUsers/`. Open them
152-
individually (or via the test runner script) when you need to verify TP
153-
behavior end-to-end.
115+
Confirms the build still works in VS/MSBuild. It's very easy to write generative TP code that works in `dotnet build`
116+
but breaks in MSBuild.
154117

155118
## Edit-rebuild loop for TP work
156119

157120
1. Edit something in `src/Rezoom.SQL.Provider/`, `Rezoom.SQL.Compiler/`, or
158121
`Rezoom.SQL.Mapping/`.
159-
2. Run `./build/pack-dev.ps1`. New version is `0.13.0-dev.<N+1>`.
160-
3. Run `./src/TypeProviderUsers/test-tp-users.ps1` (or `dotnet test` the specific one
122+
2. Make sure it passes the easy tests in Rezoom.SQL.Test and Rezoom.SQL.Provider.Test.
123+
3. Run `./build/pack-dev.ps1` to generate local dev packages.
124+
4. Run `./src/TypeProviderUsers/test-tp-users.ps1` (or `dotnet test` the specific one
161125
you care about). Restore picks up the new dev version automatically.
162-
4. Iterate.
126+
5. Also run `./src/TypeProviderUsers/test-vs-build.ps1` to confirm the TP works in a VS/msbuild environment too.
163127

164128
If something doesn't update as expected, the usual suspect is a stale entry
165129
in `~/.nuget/packages/<pkg>/<version>/`. `pack-dev.ps1` clears those for the
@@ -173,5 +137,5 @@ the feed, you may need to clear by hand.
173137
3. Update `CHANGELOG.md` (when one exists) and any docs that mention versions.
174138
4. Commit. Working tree should be clean.
175139
5. Run `./build/pack-release.ps1`. Verify the resulting `.nupkg`s in the feed.
176-
6. Push to nuget.org via your usual mechanism.
140+
6. Push to nuget.org.
177141
7. Tag `v<version>` and push the tag.

doc/Language/DataTypes.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ an `int64` to an `int32`. When the typechecker encounters an expression such as
4949
`a` and `b` have the same types or one is an ancestor of the other's type.
5050

5151
A type variable such as `@x` may be unified with types in many places. The most
52-
specific type always wins, so in the expression `@x >= someInt32 and @x <
53-
someInt16`, @x is inferred to have type `int32`, because it is lower in the type
54-
hierarchy than `int16`.
52+
specific type always wins, so in the expression
53+
`@x >= someInt32 and @x < someInt16`, @x is inferred to have type `int32`,
54+
because it is lower in the type hierarchy than `int16`.
5555

5656
Here is the current type hierarchy. Notice that there are some types in the
5757
hierarchy that do not appear in the above table. These exist just as constraints
@@ -70,10 +70,10 @@ show up in the corresponding column.
7070

7171
Most expressions (like `a * b`) are assumed to be potentially null if _either_
7272
of their inputs are potentially null. When an expression uses a function, the
73-
nullability depends on the function. For example, in TSQL, the `power(base,
74-
power)` function has "infectious" arguments in that if either of them is
75-
nullable, the output is inferred to be nullable. However, the `coalesce`
76-
function's output is only nullable if its last argument is nullable.
73+
nullability depends on the function. For example, in TSQL, the
74+
`power(base, power)` function has "infectious" arguments in that if either of
75+
them is nullable, the output is inferred to be nullable. However, the
76+
`coalesce` function's output is only nullable if its last argument is nullable.
7777

7878
When a query is parameterized, RZSQL must also figure out which parameters
7979
should be nullable. To this end, it assumes some expressions must be nullable.
@@ -127,8 +127,8 @@ In the simplest case, as seen above, the expression is a parameter, like
127127
nullable.
128128

129129
This also works for somewhat more complex expressions. For example, it could be
130-
a binary operation like `@count + 1`, or even a scalar sub-query, like `(select
131-
@name as n)`. In both these cases. the typechecker concludes that the whole
130+
a binary operation like `@count + 1`, or even a scalar sub-query, like
131+
`(select @name as n)`. In both these cases. the typechecker concludes that the whole
132132
subquery's result is nullable if-and-only-if the parameter in question is
133133
nullable, so again, it makes the parameter's type nullable to satisfy the
134134
constraint.

doc/Language/Quirks/PostgresQuirks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ There is no data type in Postgres that stores a date, time, and timezone offset.
2121

2222
You would think that `TIMESTAMP WITH TIME ZONE` would do that, but it does not.
2323
It stores a UTC timestamp, and annoyingly converts it to different local times
24-
in various situations such as during conversion to `TIMESTAMP WITHOUT TIME
25-
ZONE`. It is baffling to me why anybody would ever want a database to be aware
26-
of anybody's local time, but I'm not the database guy.
24+
in various situations such as during conversion to
25+
`TIMESTAMP WITHOUT TIME ZONE`. It is baffling to me why anybody would ever
26+
want a database to be aware of anybody's local time, but I'm not the database guy.
2727

2828
When using RZSQL, both the `DateTime` and `DateTimeOffset` types are mapped to
2929
`TIMESTAMP WITH TIME ZONE`. With both types, querying the DB will give you a UTC

doc/Language/Quirks/TSQLQuirks.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ work for comparison with a literal `NULL` -- you can't, for example, compare two
2626
columns this way.
2727

2828
When faced with a usage of `IS` or `IS NOT` that doesn't have a literal `NULL`
29-
as its right-hand side, RZSQL uses this idiom for `LeftSideExpr IS
30-
RightSideExpr`:
29+
as its right-hand side, RZSQL uses this idiom for
30+
`LeftSideExpr IS RightSideExpr`:
3131

3232
```sql
3333
EXISTS(SELECT LeftSideExpr INTERSECT SELECT RightSideExpr);
@@ -69,8 +69,8 @@ whenever a "fake boolean" is used in a boolean clause:
6969
SELECT * FROM SomeTable WHERE (SomeBitColumn<>0)
7070
```
7171

72-
Conversely, it adds a `CASE` expression whenever a boolean expression such as `x
73-
< y` is used where a scalar value is needed:
72+
Conversely, it adds a `CASE` expression whenever a boolean expression such as
73+
`x < y` is used where a scalar value is needed:
7474

7575
```sql
7676
SELECT
@@ -129,8 +129,8 @@ T-SQL models default values as constraints, and refuses to let you drop a column
129129
while it has constraints referencing it, even if the constraints will become
130130
completely pointless once the column is gone.
131131

132-
Therefore, you must `ALTER TABLE DROP DEFAULT FOR ColumnName` before you `ALTER
133-
TABLE DROP COLUMN ColumnName`, if the column has a default value.
132+
Therefore, you must `ALTER TABLE DROP DEFAULT FOR ColumnName` before you
133+
`ALTER TABLE DROP COLUMN ColumnName`, if the column has a default value.
134134

135135
You'll get informed of this at compile time.
136136

doc/Language/SelectStmt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ The four compound operators supported by RZSQL are:
255255
* `EXCEPT`: the result set contains all rows from the left compound term **not
256256
found in** the right compound term.
257257

258-
Compound operators are all left-associative, meaning that `x except y union all
259-
z` groups like `(x except y) union all z`. The parentheses here are purely for
258+
Compound operators are all left-associative, meaning that
259+
`x except y union all z` groups like `(x except y) union all z`. The parentheses here are purely for
260260
illustration. In RZSQL, you _cannot_ use parentheses around compound exprs to
261261
override their associativity. If you need an associativity other than
262262
left-to-right, you'll need to use subqueries instead.

doc/Language/UserTypes/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ module MyCustomMappings =
130130
static member FromPrimitive(str : string) = DateOnly.ParseExact(str, "o")
131131
```
132132

133-
You can have as many classes as you want defining static custom mappings. But you can't split the mapping for a *single
134-
UserType* across multiple classes. `ToPrimitive : Foo -> string` has to be defined in the *same* class as `FromPrimitive
135-
: string -> Foo` for the mapping to be valid.
133+
You can have as many classes as you want defining static custom mappings. But you can't split the mapping for a
134+
*single UserType* across multiple classes. `ToPrimitive : Foo -> string` has to be defined in the *same* class as
135+
`FromPrimitive : string -> Foo` for the mapping to be valid.
136136

137137
## Using the mapped types
138138

@@ -426,8 +426,8 @@ harder to follow for any reader of your code.
426426

427427
You cannot map a .NET generic type as a UserType. For example, maybe every entity in your domain has a Guid PK. You
428428
might wish to write a single `type Id<'a> = Id of Guid` and then use `Id<User>`, `Id<Group>`, etc. instead of defining
429-
individual types for each one. This is not supported. You'll have to use `type UserId = UserId of Guid` and `type
430-
GroupId = GroupId of Guid` and so on.
429+
individual types for each one. This is not supported. You'll have to use
430+
`type UserId = UserId of Guid` and `type GroupId = GroupId of Guid` and so on.
431431

432432
### Changes affecting schema
433433

doc/Tutorial/LoadingNestedObjects.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ users. Behind the scenes, it is getting the same old flat result set from SQL,
6060
but it processes it into a nested collection of objects in memory. In order to
6161
do this, it must have some way to de-duplicate the repeated user information. By
6262
default, this is done by comparing all the columns at the user level of the
63-
query that are selected from primary key columns -- in this case, just `u.Id as
64-
UserId`.
63+
query that are selected from primary key columns -- in this case, just
64+
`u.Id as UserId`.
6565

6666
You can read more about this feature on the [Navigation
6767
Properties](../Language/NavigationProperties.md) page.

0 commit comments

Comments
 (0)