@effect/sql-pglite 4.0.4 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,22 +21,28 @@ import { FetchHttpClient } from "effect/http"
21
21
  // }
22
22
  // }
23
23
  //
24
- // Each nested selection is its own class, so editor hovers show its name.
25
- export class PageInfo extends Schema.Opaque<PageInfo>()(
26
- Schema.Struct({ hasNextPage: Schema.Boolean, endCursor: Schema.NullOr(Schema.String) })
27
- ) {}
24
+ // Each nested object selection has a Schema.Struct const and a same-named
25
+ // interface for its decoded type. The const handles decoding, encoding and
26
+ // `make`; use the interface in explicit type annotations when a named type
27
+ // is useful. Inferred types and editor hovers can expand structurally rather
28
+ // than showing the names, unlike the previous Schema.Opaque classes.
29
+ export const PageInfo = Schema.Struct({
30
+ hasNextPage: Schema.Boolean,
31
+ endCursor: Schema.NullOr(Schema.String)
32
+ })
33
+ export interface PageInfo extends Schema.Struct.Type<typeof PageInfo.fields> {}
28
34
 
29
- export class Issue extends Schema.Opaque<Issue>()(
30
- Schema.Struct({ number: Schema.Int, title: Schema.String })
31
- ) {}
35
+ export const Issue = Schema.Struct({ number: Schema.Int, title: Schema.String })
36
+ export interface Issue extends Schema.Struct.Type<typeof Issue.fields> {}
32
37
 
33
- export class IssueConnection extends Schema.Opaque<IssueConnection>()(
34
- Schema.Struct({ pageInfo: PageInfo, nodes: Schema.NullOr(Schema.Array(Schema.NullOr(Issue))) })
35
- ) {}
38
+ export const IssueConnection = Schema.Struct({
39
+ pageInfo: PageInfo,
40
+ nodes: Schema.NullOr(Schema.Array(Schema.NullOr(Issue)))
41
+ })
42
+ export interface IssueConnection extends Schema.Struct.Type<typeof IssueConnection.fields> {}
36
43
 
37
- export class Repository extends Schema.Opaque<Repository>()(
38
- Schema.Struct({ issues: IssueConnection })
39
- ) {}
44
+ export const Repository = Schema.Struct({ issues: IssueConnection })
45
+ export interface Repository extends Schema.Struct.Type<typeof Repository.fields> {}
40
46
 
41
47
  export const RepoIssues = GraphQL.query("RepoIssues", {
42
48
  document:
@@ -26,15 +26,17 @@ declare namespace Shared {
26
26
  }
27
27
  }
28
28
 
29
- export class Repository extends Schema.Opaque<Repository>()(Schema.Struct({
29
+ export const Repository = Schema.Struct({
30
30
  __typename: Schema.Literal("Repository"),
31
31
  nameWithOwner: Schema.String
32
- })) {}
32
+ })
33
+ export interface Repository extends Schema.Struct.Type<typeof Repository.fields> {}
33
34
 
34
35
  // Unselected node types are represented by `otherTypename`.
35
- export class NodeOther extends Schema.Opaque<NodeOther>()(Schema.Struct({
36
+ export const NodeOther = Schema.Struct({
36
37
  __typename: GraphQL.otherTypename<Shared.Typename.Node>()(["Repository"])
37
- })) {}
38
+ })
39
+ export interface NodeOther extends Schema.Struct.Type<typeof NodeOther.fields> {}
38
40
 
39
41
  /** `query RepoNodes` */
40
42
  export const RepoNodes = GraphQL.query("RepoNodes", {
@@ -23,14 +23,16 @@ import { GitHubAuth } from "./10_basics.ts"
23
23
  // "../schema.graphql.ts"`); here `Shared` is declared inline.
24
24
  const Shared = { Int: Schema.Number.check(Schema.isInt32()) }
25
25
 
26
- export class PullRequestPullRequest extends Schema.Opaque<PullRequestPullRequest>()(Schema.Struct({
26
+ export const PullRequestPullRequest = Schema.Struct({
27
27
  number: Shared.Int,
28
28
  title: Schema.String
29
- })) {}
29
+ })
30
+ export interface PullRequestPullRequest extends Schema.Struct.Type<typeof PullRequestPullRequest.fields> {}
30
31
 
31
- export class Repository extends Schema.Opaque<Repository>()(Schema.Struct({
32
+ export const Repository = Schema.Struct({
32
33
  pullRequest: Schema.NullOr(PullRequestPullRequest)
33
- })) {}
34
+ })
35
+ export interface Repository extends Schema.Struct.Type<typeof Repository.fields> {}
34
36
 
35
37
  // The generator gives queries and mutations their document as a
36
38
  // `GraphQL.DocumentTemplate`. The odd entries of each `body` are the names
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/sql-pglite",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "A PGlite toolkit for Effect",
@@ -51,10 +51,10 @@
51
51
  "provenance": true
52
52
  },
53
53
  "devDependencies": {
54
- "effect": "^4.0.4"
54
+ "effect": "^4.0.5"
55
55
  },
56
56
  "peerDependencies": {
57
- "effect": "^4.0.4"
57
+ "effect": "^4.0.5"
58
58
  },
59
59
  "dependencies": {
60
60
  "@electric-sql/pglite": "^0.5.8"