Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
drodrigues4 committed Jul 23, 2024
1 parent 5bce7e5 commit a93f002
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 25 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/release-to-github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Build
- name: Generate prisma schemas
run: |
(
cd drizzle-orm
Expand All @@ -107,9 +107,16 @@ jobs:
pnpm prisma generate --schema tests/prisma/mysql/schema.prisma
pnpm prisma generate --schema tests/prisma/sqlite/schema.prisma
)
- name: Build
working-directory: ${{ matrix.package }}
run: |
jq '.name="@singlestore-labs/${{ matrix.package }}"' package.json --tab > tmp.$$.json && mv tmp.$$.json package.json
pnpm build
- name: Run tests
if: 0
env:
PG_CONNECTION_STRING: postgres://postgres:postgres@localhost:55433/drizzle
PG_VECTOR_CONNECTION_STRING: postgres://postgres:postgres@localhost:54321/drizzle
Expand Down Expand Up @@ -137,6 +144,7 @@ jobs:
npm run pack
- name: Run @arethetypeswrong/cli
if: 0
working-directory: ${{ matrix.package }}
shell: bash
env:
Expand All @@ -148,9 +156,12 @@ jobs:
working-directory: ${{ matrix.package }}
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version="${{ steps.checks.outputs.version }}"
version=latest
echo "@singlestore-labs:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
echo "Publishing ${{ matrix.package }}@$version"
npm run publish
Expand Down
22 changes: 10 additions & 12 deletions drizzle-orm/src/singlestore-core/columns/guid.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ColumnBaseConfig } from '~/column';
import { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder';
import { entityKind } from '~/entity';
import { AnySingleStoreTable } from '~/singlestore-core/table';
import { sql } from '~/sql/sql';
import { Equal } from '~/utils';
import { SingleStoreColumn, SingleStoreColumnBuilder } from './common';
import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder';
import type { ColumnBaseConfig } from '~/column.ts';
import { entityKind } from '~/entity.ts';
import type { AnySingleStoreTable } from '~/singlestore-core/table';
import { sql } from '~/sql/sql.ts';
import type { Equal } from '~/utils';
import { SingleStoreColumn, SingleStoreColumnBuilder } from './common.ts';

export type SingleStoreGUIDBuilderInitial<TName extends string> = SingleStoreGUIDBuilder<{
name: TName;
Expand All @@ -21,7 +21,7 @@ export class SingleStoreGUIDBuilder<T extends ColumnBuilderBaseConfig<'buffer',
{
static readonly [entityKind]: string = 'SingleStoreGUIDBuilder';

constructor(name: T['name'], config?: SingleStoreGUIDConfig) {
constructor(name: T['name'], _config?: SingleStoreGUIDConfig) {
super(name, 'buffer', 'SingleStoreGUID');
}

Expand Down Expand Up @@ -64,7 +64,7 @@ export class SingleStoreGUIDStringBuilder<T extends ColumnBuilderBaseConfig<'str
{
static readonly [entityKind]: string = 'SingleStoreGUIDStringBuilder';

constructor(name: T['name'], config?: SingleStoreGUIDConfig) {
constructor(name: T['name'], _config?: SingleStoreGUIDConfig) {
super(name, 'string', 'SingleStoreGUIDString');
}

Expand Down Expand Up @@ -95,9 +95,7 @@ export class SingleStoreGUIDString<T extends ColumnBaseConfig<'string', 'SingleS

override mapFromDriverValue(value: Uint8Array): string {
const hex = Buffer.from(value).toString('hex');
return `${hex.substring(0, 8)}-${hex.substring(8, 12)}-${hex.substring(12, 16)}-${hex.substring(16, 20)}-${
hex.substring(20)
}`;
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
}
}

Expand Down
10 changes: 5 additions & 5 deletions drizzle-orm/src/singlestore-core/columns/uuid.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ColumnBaseConfig } from '~/column';
import { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder';
import { entityKind } from '~/entity';
import { AnySingleStoreTable } from '~/singlestore-core/table';
import { SingleStoreColumn, SingleStoreColumnBuilder } from './common';
import type { ColumnBaseConfig } from '~/column';
import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder';
import { entityKind } from '~/entity.ts';
import type { AnySingleStoreTable } from '~/singlestore-core/table';
import { SingleStoreColumn, SingleStoreColumnBuilder } from './common.ts';

export type SingleStoreUUIDBuilderInitial<TName extends string> = SingleStoreUUIDBuilder<{
name: TName;
Expand Down
10 changes: 5 additions & 5 deletions drizzle-orm/src/singlestore-core/columns/vector.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ColumnBaseConfig } from '~/column';
import { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder';
import { entityKind } from '~/entity';
import { AnySingleStoreTable } from '~/singlestore-core/table';
import { SingleStoreColumn, SingleStoreColumnBuilder } from './common';
import type { ColumnBaseConfig } from '~/column';
import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder';
import { entityKind } from '~/entity.ts';
import type { AnySingleStoreTable } from '~/singlestore-core/table';
import { SingleStoreColumn, SingleStoreColumnBuilder } from './common.ts';

export type SingleStoreVectorBuilderInitial<TName extends string> = SingleStoreVectorBuilder<{
name: TName;
Expand Down

0 comments on commit a93f002

Please sign in to comment.