Skip to content

Commit

Permalink
these files need changing too...
Browse files Browse the repository at this point in the history
  • Loading branch information
zth committed May 1, 2024
1 parent b103145 commit ac96717
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 34 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/generator.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ParameterTransform } from '@pgtyped/runtime';
import { ParameterTransform } from 'pgtyped-rescript-runtime';

import { parseSQLFile } from '@pgtyped/parser';
import { IQueryTypes } from 'pgtyped-rescript-query/lib/actions';
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ParameterTransform,
processSQLQueryIR,
processTSQueryAST,
} from '@pgtyped/runtime';
} from 'pgtyped-rescript-runtime';

import {
parseSQLFile,
Expand Down Expand Up @@ -340,7 +340,7 @@ export async function generateDeclarationFile(
if (mode === 'sql') {
// Second parameter has no effect here, we could have used any value
types.use(
{ name: 'PreparedQuery', from: '@pgtyped/runtime' },
{ name: 'PreparedQuery', from: 'pgtyped-rescript-runtime' },
TypeScope.Return,
);
}
Expand Down Expand Up @@ -409,7 +409,7 @@ module ${
typeDec.query.name
}Params) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external ${
@module("pgtyped-rescript-runtime") @new external ${
typeDec.query.name
}: IR.t => PreparedStatement.t<${typeDec.query.paramTypeAlias}, ${
typeDec.query.returnTypeAlias
Expand Down
4 changes: 2 additions & 2 deletions packages/example/src/books/BookService__sql.res
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module FindBookById: {
@gentype
let execute: (PgTyped.Pg.Client.t, findBookByIdParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external findBookById: IR.t => PreparedStatement.t<findBookByIdParams, findBookByIdResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external findBookById: IR.t => PreparedStatement.t<findBookByIdParams, findBookByIdResult> = "PreparedQuery";
let query = findBookById(findBookByIdIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -153,7 +153,7 @@ module BooksByAuthor: {
@gentype
let execute: (PgTyped.Pg.Client.t, booksByAuthorParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external booksByAuthor: IR.t => PreparedStatement.t<booksByAuthorParams, booksByAuthorResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external booksByAuthor: IR.t => PreparedStatement.t<booksByAuthorParams, booksByAuthorResult> = "PreparedQuery";
let query = booksByAuthor(booksByAuthorIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/books/books.queries.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Types generated for queries found in "src/books/books.sql" */
import { Category } from '../customTypes';

import { PreparedQuery } from '@pgtyped/runtime';
import { PreparedQuery } from 'pgtyped-rescript-runtime';

export type Iso31661Alpha2 = 'AD' | 'AE' | 'AF' | 'AG' | 'AI' | 'AL' | 'AM' | 'AO' | 'AQ' | 'AR' | 'AS' | 'AT' | 'AU' | 'AW' | 'AX' | 'AZ' | 'BA' | 'BB' | 'BD' | 'BE' | 'BF' | 'BG' | 'BH' | 'BI' | 'BJ' | 'BL' | 'BM' | 'BN' | 'BO' | 'BQ' | 'BR' | 'BS' | 'BT' | 'BV' | 'BW' | 'BY' | 'BZ' | 'CA' | 'CC' | 'CD' | 'CF' | 'CG' | 'CH' | 'CI' | 'CK' | 'CL' | 'CM' | 'CN' | 'CO' | 'CR' | 'CU' | 'CV' | 'CW' | 'CX' | 'CY' | 'CZ' | 'DE' | 'DJ' | 'DK' | 'DM' | 'DO' | 'DZ' | 'EC' | 'EE' | 'EG' | 'EH' | 'ER' | 'ES' | 'ET' | 'FI' | 'FJ' | 'FK' | 'FM' | 'FO' | 'FR' | 'GA' | 'GB' | 'GD' | 'GE' | 'GF' | 'GG' | 'GH' | 'GI' | 'GL' | 'GM' | 'GN' | 'GP' | 'GQ' | 'GR' | 'GS' | 'GT' | 'GU' | 'GW' | 'GY' | 'HK' | 'HM' | 'HN' | 'HR' | 'HT' | 'HU' | 'ID' | 'IE' | 'IL' | 'IM' | 'IN' | 'IO' | 'IQ' | 'IR' | 'IS' | 'IT' | 'JE' | 'JM' | 'JO' | 'JP' | 'KE' | 'KG' | 'KH' | 'KI' | 'KM' | 'KN' | 'KP' | 'KR' | 'KW' | 'KY' | 'KZ' | 'LA' | 'LB' | 'LC' | 'LI' | 'LK' | 'LR' | 'LS' | 'LT' | 'LU' | 'LV' | 'LY' | 'MA' | 'MC' | 'MD' | 'ME' | 'MF' | 'MG' | 'MH' | 'MK' | 'ML' | 'MM' | 'MN' | 'MO' | 'MP' | 'MQ' | 'MR' | 'MS' | 'MT' | 'MU' | 'MV' | 'MW' | 'MX' | 'MY' | 'MZ' | 'NA' | 'NC' | 'NE' | 'NF' | 'NG' | 'NI' | 'NL' | 'NO' | 'NP' | 'NR' | 'NU' | 'NZ' | 'OM' | 'PA' | 'PE' | 'PF' | 'PG' | 'PH' | 'PK' | 'PL' | 'PM' | 'PN' | 'PR' | 'PS' | 'PT' | 'PW' | 'PY' | 'QA' | 'RE' | 'RO' | 'RS' | 'RU' | 'RW' | 'SA' | 'SB' | 'SC' | 'SD' | 'SE' | 'SG' | 'SH' | 'SI' | 'SJ' | 'SK' | 'SL' | 'SM' | 'SN' | 'SO' | 'SR' | 'SS' | 'ST' | 'SV' | 'SX' | 'SY' | 'SZ' | 'TC' | 'TD' | 'TF' | 'TG' | 'TH' | 'TJ' | 'TK' | 'TL' | 'TM';

Expand Down
28 changes: 14 additions & 14 deletions packages/example/src/books/books__sql.res
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module FindBookById: {
@gentype
let execute: (PgTyped.Pg.Client.t, findBookByIdParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external findBookById: IR.t => PreparedStatement.t<findBookByIdParams, findBookByIdResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external findBookById: IR.t => PreparedStatement.t<findBookByIdParams, findBookByIdResult> = "PreparedQuery";
let query = findBookById(findBookByIdIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -160,7 +160,7 @@ module FindBookByCategory: {
@gentype
let execute: (PgTyped.Pg.Client.t, findBookByCategoryParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external findBookByCategory: IR.t => PreparedStatement.t<findBookByCategoryParams, findBookByCategoryResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external findBookByCategory: IR.t => PreparedStatement.t<findBookByCategoryParams, findBookByCategoryResult> = "PreparedQuery";
let query = findBookByCategory(findBookByCategoryIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -243,7 +243,7 @@ module FindBookNameOrRank: {
@gentype
let execute: (PgTyped.Pg.Client.t, findBookNameOrRankParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external findBookNameOrRank: IR.t => PreparedStatement.t<findBookNameOrRankParams, findBookNameOrRankResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external findBookNameOrRank: IR.t => PreparedStatement.t<findBookNameOrRankParams, findBookNameOrRankResult> = "PreparedQuery";
let query = findBookNameOrRank(findBookNameOrRankIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -326,7 +326,7 @@ module FindBookUnicode: {
@gentype
let execute: (PgTyped.Pg.Client.t, findBookUnicodeParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external findBookUnicode: IR.t => PreparedStatement.t<findBookUnicodeParams, findBookUnicodeResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external findBookUnicode: IR.t => PreparedStatement.t<findBookUnicodeParams, findBookUnicodeResult> = "PreparedQuery";
let query = findBookUnicode(findBookUnicodeIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -413,7 +413,7 @@ module InsertBooks: {
@gentype
let execute: (PgTyped.Pg.Client.t, insertBooksParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external insertBooks: IR.t => PreparedStatement.t<insertBooksParams, insertBooksResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external insertBooks: IR.t => PreparedStatement.t<insertBooksParams, insertBooksResult> = "PreparedQuery";
let query = insertBooks(insertBooksIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -496,7 +496,7 @@ module InsertBook: {
@gentype
let execute: (PgTyped.Pg.Client.t, insertBookParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external insertBook: IR.t => PreparedStatement.t<insertBookParams, insertBookResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external insertBook: IR.t => PreparedStatement.t<insertBookParams, insertBookResult> = "PreparedQuery";
let query = insertBook(insertBookIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -582,7 +582,7 @@ module UpdateBooksCustom: {
@gentype
let execute: (PgTyped.Pg.Client.t, updateBooksCustomParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external updateBooksCustom: IR.t => PreparedStatement.t<updateBooksCustomParams, updateBooksCustomResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external updateBooksCustom: IR.t => PreparedStatement.t<updateBooksCustomParams, updateBooksCustomResult> = "PreparedQuery";
let query = updateBooksCustom(updateBooksCustomIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -666,7 +666,7 @@ module UpdateBooks: {
@gentype
let execute: (PgTyped.Pg.Client.t, updateBooksParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external updateBooks: IR.t => PreparedStatement.t<updateBooksParams, updateBooksResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external updateBooks: IR.t => PreparedStatement.t<updateBooksParams, updateBooksResult> = "PreparedQuery";
let query = updateBooks(updateBooksIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -749,7 +749,7 @@ module UpdateBooksRankNotNull: {
@gentype
let execute: (PgTyped.Pg.Client.t, updateBooksRankNotNullParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external updateBooksRankNotNull: IR.t => PreparedStatement.t<updateBooksRankNotNullParams, updateBooksRankNotNullResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external updateBooksRankNotNull: IR.t => PreparedStatement.t<updateBooksRankNotNullParams, updateBooksRankNotNullResult> = "PreparedQuery";
let query = updateBooksRankNotNull(updateBooksRankNotNullIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -836,7 +836,7 @@ module GetBooksByAuthorName: {
@gentype
let execute: (PgTyped.Pg.Client.t, getBooksByAuthorNameParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external getBooksByAuthorName: IR.t => PreparedStatement.t<getBooksByAuthorNameParams, getBooksByAuthorNameResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external getBooksByAuthorName: IR.t => PreparedStatement.t<getBooksByAuthorNameParams, getBooksByAuthorNameResult> = "PreparedQuery";
let query = getBooksByAuthorName(getBooksByAuthorNameIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -916,7 +916,7 @@ module AggregateEmailsAndTest: {
@gentype
let execute: (PgTyped.Pg.Client.t, aggregateEmailsAndTestParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external aggregateEmailsAndTest: IR.t => PreparedStatement.t<aggregateEmailsAndTestParams, aggregateEmailsAndTestResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external aggregateEmailsAndTest: IR.t => PreparedStatement.t<aggregateEmailsAndTestParams, aggregateEmailsAndTestResult> = "PreparedQuery";
let query = aggregateEmailsAndTest(aggregateEmailsAndTestIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -994,7 +994,7 @@ module GetBooks: {
@gentype
let execute: (PgTyped.Pg.Client.t, getBooksParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external getBooks: IR.t => PreparedStatement.t<getBooksParams, getBooksResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external getBooks: IR.t => PreparedStatement.t<getBooksParams, getBooksResult> = "PreparedQuery";
let query = getBooks(getBooksIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -1071,7 +1071,7 @@ module CountBooks: {
@gentype
let execute: (PgTyped.Pg.Client.t, countBooksParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external countBooks: IR.t => PreparedStatement.t<countBooksParams, countBooksResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external countBooks: IR.t => PreparedStatement.t<countBooksParams, countBooksResult> = "PreparedQuery";
let query = countBooks(countBooksIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -1149,7 +1149,7 @@ module GetBookCountries: {
@gentype
let execute: (PgTyped.Pg.Client.t, getBookCountriesParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external getBookCountries: IR.t => PreparedStatement.t<getBookCountriesParams, getBookCountriesResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external getBookCountries: IR.t => PreparedStatement.t<getBookCountriesParams, getBookCountriesResult> = "PreparedQuery";
let query = getBookCountries(getBookCountriesIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/comments/comments.queries.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** Types generated for queries found in "src/comments/comments.sql" */
import { PreparedQuery } from '@pgtyped/runtime';
import { PreparedQuery } from 'pgtyped-rescript-runtime';

/** 'GetAllComments' parameters type */
export interface IGetAllCommentsParams {
Expand Down
8 changes: 4 additions & 4 deletions packages/example/src/comments/comments__sql.res
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module GetAllComments: {
@gentype
let execute: (PgTyped.Pg.Client.t, getAllCommentsParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external getAllComments: IR.t => PreparedStatement.t<getAllCommentsParams, getAllCommentsResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external getAllComments: IR.t => PreparedStatement.t<getAllCommentsParams, getAllCommentsResult> = "PreparedQuery";
let query = getAllComments(getAllCommentsIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -136,7 +136,7 @@ module GetAllCommentsByIds: {
@gentype
let execute: (PgTyped.Pg.Client.t, getAllCommentsByIdsParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external getAllCommentsByIds: IR.t => PreparedStatement.t<getAllCommentsByIdsParams, getAllCommentsByIdsResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external getAllCommentsByIds: IR.t => PreparedStatement.t<getAllCommentsByIdsParams, getAllCommentsByIdsResult> = "PreparedQuery";
let query = getAllCommentsByIds(getAllCommentsByIdsIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -225,7 +225,7 @@ module InsertComment: {
@gentype
let execute: (PgTyped.Pg.Client.t, insertCommentParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external insertComment: IR.t => PreparedStatement.t<insertCommentParams, insertCommentResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external insertComment: IR.t => PreparedStatement.t<insertCommentParams, insertCommentResult> = "PreparedQuery";
let query = insertComment(insertCommentIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -302,7 +302,7 @@ module SelectExistsTest: {
@gentype
let execute: (PgTyped.Pg.Client.t, selectExistsTestParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external selectExistsTest: IR.t => PreparedStatement.t<selectExistsTestParams, selectExistsTestResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external selectExistsTest: IR.t => PreparedStatement.t<selectExistsTestParams, selectExistsTestResult> = "PreparedQuery";
let query = selectExistsTest(selectExistsTestIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** Types generated for queries found in "src/notifications/notifications.sql" */
import { PreparedQuery } from '@pgtyped/runtime';
import { PreparedQuery } from 'pgtyped-rescript-runtime';

export type notification_type = 'deadline' | 'notification' | 'reminder';

Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/notifications/notifications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sql } from '@pgtyped/runtime';
import { sql } from 'pgtyped-rescript-runtime';
import {
IInsertNotificationQuery,
IInsertNotificationsQuery,
Expand Down
6 changes: 3 additions & 3 deletions packages/example/src/notifications/notifications__sql.res
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module SendNotifications: {
@gentype
let execute: (PgTyped.Pg.Client.t, sendNotificationsParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external sendNotifications: IR.t => PreparedStatement.t<sendNotificationsParams, sendNotificationsResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external sendNotifications: IR.t => PreparedStatement.t<sendNotificationsParams, sendNotificationsResult> = "PreparedQuery";
let query = sendNotifications(sendNotificationsIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -148,7 +148,7 @@ module GetNotifications: {
@gentype
let execute: (PgTyped.Pg.Client.t, getNotificationsParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external getNotifications: IR.t => PreparedStatement.t<getNotificationsParams, getNotificationsResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external getNotifications: IR.t => PreparedStatement.t<getNotificationsParams, getNotificationsResult> = "PreparedQuery";
let query = getNotifications(getNotificationsIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down Expand Up @@ -232,7 +232,7 @@ module ThresholdFrogs: {
@gentype
let execute: (PgTyped.Pg.Client.t, thresholdFrogsParams) => promise<unit>
} = {
@module("@pgtyped/runtime") @new external thresholdFrogs: IR.t => PreparedStatement.t<thresholdFrogsParams, thresholdFrogsResult> = "PreparedQuery";
@module("pgtyped-rescript-runtime") @new external thresholdFrogs: IR.t => PreparedStatement.t<thresholdFrogsParams, thresholdFrogsResult> = "PreparedQuery";
let query = thresholdFrogs(thresholdFrogsIR)
let query = (params, ~client) => query->PreparedStatement.run(params, ~client)

Expand Down
2 changes: 1 addition & 1 deletion packages/example/src/users/sample.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sql } from '@pgtyped/runtime';
import { sql } from 'pgtyped-rescript-runtime';
import { IGetUsersWithCommentsQuery } from './sample.types.js';
import { Client } from 'pg';

Expand Down
5 changes: 4 additions & 1 deletion packages/query/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { AsyncQueue, messages, PreparedObjectType } from '@pgtyped/wire';
import crypto from 'crypto';
import debugBase from 'debug';
import * as tls from 'tls';
import type { InterpolatedQuery, QueryParameter } from '@pgtyped/runtime';
import type {
InterpolatedQuery,
QueryParameter,
} from 'pgtyped-rescript-runtime';
import {
checkServerFinalMessage,
createClientSASLContinueResponse,
Expand Down
2 changes: 1 addition & 1 deletion packages/query/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InterpolatedQuery } from '@pgtyped/runtime';
import { InterpolatedQuery } from 'pgtyped-rescript-runtime';
import { IParseError, IQueryTypes } from './actions.js';

export { getTypes, startup, IParseError, IQueryTypes } from './actions.js';
Expand Down

0 comments on commit ac96717

Please sign in to comment.