Skip to content

Commit

Permalink
Upgrade dependencies (#181)
Browse files Browse the repository at this point in the history
* upgrade dependencies

* revert monorepo deps update

* fix checks for examples

* Add changeset
  • Loading branch information
jmatsushita authored May 5, 2024
1 parent 99b0ef1 commit df96ae2
Show file tree
Hide file tree
Showing 16 changed files with 1,254 additions and 1,010 deletions.
10 changes: 10 additions & 0 deletions .changeset/polite-parrots-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@sqlfx/mysql2": minor
"@sqlfx/sqlite": minor
"@sqlfx/mssql": minor
"@sqlfx/mysql": minor
"@sqlfx/sql": minor
"@sqlfx/pg": minor
---

Upgraded to [email protected] and @effect/schema@0.66.14
2 changes: 1 addition & 1 deletion packages/mssql/examples/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const program = Effect.gen(function* (_) {
Effect.zipRight(
Effect.catchAllCause(
sql.withTransaction(Effect.die("fail")),
_ => Effect.unit,
_ => Effect.void,
),
),
Effect.zipRight(
Expand Down
6 changes: 3 additions & 3 deletions packages/mssql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"sideEffects": false,
"dependencies": {
"@sqlfx/sql": "workspace:^",
"tedious": "^18.1.0"
"tedious": "^18.2.0"
},
"devDependencies": {
"@effect/schema": "^0.64.4",
"effect": "^2.4.7"
"@effect/schema": "^0.66.14",
"effect": "^3.1.2"
},
"peerDependencies": {
"effect": "^2.4.7"
Expand Down
12 changes: 6 additions & 6 deletions packages/mssql/src/internal/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const make = (
if (err) {
resume(Effect.fail(SqlError(err.message, err)))
} else {
resume(Effect.unit)
resume(Effect.void)
}
})
}),
Expand Down Expand Up @@ -213,7 +213,7 @@ export const make = (
if (err) {
resume(Effect.fail(SqlError(err.message, err)))
} else {
resume(Effect.unit)
resume(Effect.void)
}
})
}),
Expand All @@ -222,7 +222,7 @@ export const make = (
if (err) {
resume(Effect.fail(SqlError(err.message, err)))
} else {
resume(Effect.unit)
resume(Effect.void)
}
})
}),
Expand All @@ -233,7 +233,7 @@ export const make = (
if (err) {
resume(Effect.fail(SqlError(err.message, err)))
} else {
resume(Effect.unit)
resume(Effect.void)
}
}, name)
}),
Expand All @@ -243,7 +243,7 @@ export const make = (
if (err) {
resume(Effect.fail(SqlError(err.message, err)))
} else {
resume(Effect.unit)
resume(Effect.void)
}
}, name)
}),
Expand Down Expand Up @@ -293,7 +293,7 @@ export const make = (
([conn, id], exit) =>
Exit.isSuccess(exit)
? id > 0
? Effect.unit
? Effect.void
: Effect.orDie(conn.commit)
: Effect.orDie(conn.rollback(id > 0 ? `sqlfx${id}` : undefined)),
),
Expand Down
6 changes: 3 additions & 3 deletions packages/mysql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"sideEffects": false,
"dependencies": {
"@sqlfx/sql": "workspace:^",
"mariadb": "^3.2.3"
"mariadb": "^3.3.0"
},
"devDependencies": {
"@effect/schema": "^0.64.4",
"effect": "^2.4.7"
"@effect/schema": "^0.66.14",
"effect": "^3.1.2"
},
"peerDependencies": {
"effect": "^2.4.7"
Expand Down
6 changes: 3 additions & 3 deletions packages/mysql2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"sideEffects": false,
"dependencies": {
"@sqlfx/sql": "workspace:^",
"mysql2": "^3.9.3"
"mysql2": "^3.9.7"
},
"devDependencies": {
"@effect/schema": "^0.64.4",
"effect": "^2.4.7"
"@effect/schema": "^0.66.14",
"effect": "^3.1.2"
},
"peerDependencies": {
"effect": "^2.4.7"
Expand Down
10 changes: 5 additions & 5 deletions packages/pg/examples/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import * as Effect from "effect/Effect"
import { pipe } from "effect/Function"

class Person extends Schema.Class<Person>("Person")({
id: Schema.number,
name: Schema.string,
id: Schema.Number,
name: Schema.String,
createdAt: Schema.DateFromSelf,
}) {}

const InsertPersonSchema = pipe(
Schema.struct(Person.fields),
Schema.Struct(Person.fields),
Schema.omit("id", "createdAt"),
)

Expand All @@ -26,14 +26,14 @@ const program = Effect.gen(function* (_) {
})

const GetById = sql.resolverId("GetPersonById", {
id: Schema.number,
id: Schema.Number,
result: Person,
resultId: _ => _.id,
run: ids => sql`SELECT * FROM people WHERE id IN ${sql(ids)}`,
})

const GetByName = sql.resolverIdMany("GetPersonByName", {
request: Schema.string,
request: Schema.String,
requestId: _ => _,
result: Person,
resultId: _ => _.name,
Expand Down
6 changes: 3 additions & 3 deletions packages/pg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
"sideEffects": false,
"dependencies": {
"@sqlfx/sql": "workspace:^",
"postgres": "3.4.3"
"postgres": "3.4.4"
},
"devDependencies": {
"@effect/schema": "^0.64.4",
"effect": "^2.4.7"
"@effect/schema": "^0.66.14",
"effect": "^3.1.2"
},
"peerDependencies": {
"effect": "^2.4.7"
Expand Down
4 changes: 2 additions & 2 deletions packages/sql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"keywords": [],
"sideEffects": false,
"devDependencies": {
"@effect/schema": "^0.64.4",
"effect": "^2.4.7"
"@effect/schema": "^0.66.14",
"effect": "^3.1.2"
},
"peerDependencies": {
"@effect/schema": "^0.64.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/sql/src/Migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { pipe } from "effect/Function"
import * as Option from "effect/Option"
import * as Effect from "effect/Effect"
import * as Order from "effect/Order"
import * as ReadonlyArray from "effect/ReadonlyArray"
import * as ReadonlyArray from "effect/Array"
import type { Client } from "./Client.js"
import type { SqlError } from "./Error.js"

Expand Down Expand Up @@ -79,7 +79,7 @@ export const make =
dumpSchema,
ensureTable,
getClient,
lockTable = () => Effect.unit,
lockTable = () => Effect.void,
}: {
getClient: Effect.Effect<R, SqlError, R>
dumpSchema: (
Expand Down
2 changes: 1 addition & 1 deletion packages/sql/src/Stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const asyncPauseResume = <R, E, A>(

const offer = (row: A) =>
Queue.isFull(queue).pipe(
Effect.tap(full => (full ? effects.onPause : Effect.unit)),
Effect.tap(full => (full ? effects.onPause : Effect.void)),
Effect.zipRight(Queue.offer(queue, row)),
Effect.zipRight(effects.onResume),
)
Expand Down
20 changes: 10 additions & 10 deletions packages/sql/src/internal/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as Exit from "effect/Exit"
import * as FiberRef from "effect/FiberRef"
import { pipe } from "effect/Function"
import * as Option from "effect/Option"
import * as ROA from "effect/ReadonlyArray"
import * as ROA from "effect/Array"
import * as request from "effect/Request"
import * as RequestResolver from "effect/RequestResolver"
import type { Client, Request, Resolver } from "../Client.js"
Expand Down Expand Up @@ -65,7 +65,7 @@ export function make({
([conn, id], exit) =>
Exit.isSuccess(exit)
? id > 0
? Effect.unit
? Effect.void
: Effect.orDie(conn.executeRaw(commit))
: id > 0
? Effect.orDie(conn.executeRaw(rollbackSavepoint(`sqlfx${id}`)))
Expand All @@ -79,7 +79,7 @@ export function make({
run: (_: II) => Effect.Effect<ReadonlyArray<unknown>, E, IR | AR | R>,
) {
const decodeResult = SqlSchema.decodeUnknown(
Schema.array(resultSchema),
Schema.Array(resultSchema),
"result",
)
const encodeRequest = SqlSchema.encode(requestSchema, "request")
Expand All @@ -96,7 +96,7 @@ export function make({
) {
const encodeRequest = SqlSchema.encode(requestSchema, "request")
return (_: IA): Effect.Effect<void, SchemaError | E, IR | R> =>
Effect.asUnit(Effect.flatMap(encodeRequest(_), run))
Effect.asVoid(Effect.flatMap(encodeRequest(_), run))
}

function schemaSingle<IR, II, IA, AR, AI, A, R, E>(
Expand Down Expand Up @@ -274,7 +274,7 @@ export function make({
): Resolver<T, R | IR, IA, void, E> {
const Request = request.tagged<Request<T, IA, E, void>>(tag)
const encodeRequests = SqlSchema.encode(
Schema.array(options.request),
Schema.Array(options.request),
"request",
)
const Resolver = RequestResolver.makeBatched(
Expand Down Expand Up @@ -324,7 +324,7 @@ export function make({
const Request =
request.tagged<Request<T, IA, E | ResultLengthMismatch, A>>(tag)
const encodeRequests = SqlSchema.encode(
Schema.array(options.request),
Schema.Array(options.request),
"request",
)
const decodeResult = SqlSchema.decodeUnknown(options.result, "result")
Expand Down Expand Up @@ -386,11 +386,11 @@ export function make({
): Resolver<T, R | IR | AR, IA, ReadonlyArray<A>, E> {
const Request = request.tagged<Request<T, IA, E, ReadonlyArray<A>>>(tag)
const encodeRequests = SqlSchema.encode(
Schema.array(options.request),
Schema.Array(options.request),
"request",
)
const decodeResults = SqlSchema.decodeUnknown(
Schema.array(options.result),
Schema.Array(options.result),
"result",
)
const Resolver = RequestResolver.makeBatched(
Expand Down Expand Up @@ -457,9 +457,9 @@ export function make({
},
): Resolver<T, R | IR | AR, IA, Option.Option<A>, E> {
const Request = request.tagged<Request<T, IA, E, Option.Option<A>>>(tag)
const encodeRequests = SqlSchema.encode(Schema.array(options.id), "request")
const encodeRequests = SqlSchema.encode(Schema.Array(options.id), "request")
const decodeResults = SqlSchema.decodeUnknown(
Schema.array(options.result),
Schema.Array(options.result),
"result",
)
const Resolver = RequestResolver.makeBatched(
Expand Down
Binary file modified packages/sqlite/examples/db.sqlite
Binary file not shown.
Binary file modified packages/sqlite/examples/db.sqlite-shm
Binary file not shown.
16 changes: 8 additions & 8 deletions packages/sqlite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
"@sqlfx/sql": "workspace:^"
},
"devDependencies": {
"@effect/schema": "^0.64.4",
"@sqlite.org/sqlite-wasm": "3.45.2-build1",
"@types/better-sqlite3": "^7.6.9",
"better-sqlite3": "^9.4.3",
"bun-types": "^1.0.31",
"effect": "^2.4.7",
"expo-sqlite": "^13.3.0",
"react-native-quick-sqlite": "^8.0.6"
"@effect/schema": "^0.66.14",
"@sqlite.org/sqlite-wasm": "3.45.3-build1",
"@types/better-sqlite3": "^7.6.10",
"better-sqlite3": "^9.6.0",
"bun-types": "^1.1.7",
"effect": "^3.1.2",
"expo-sqlite": "^13.4.0",
"react-native-quick-sqlite": "8.0.6"
},
"peerDependencies": {
"@sqlite.org/sqlite-wasm": "3.45.2-build1",
Expand Down
Loading

0 comments on commit df96ae2

Please sign in to comment.