This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT DISTINCT | |
| d.deptype, | |
| from_table.relname AS classid, | |
| COALESCE(from_class.relname, from_type.typname, from_proc.proname) AS objid, | |
| from_attr.attname AS objsubid, | |
| to_table.relname AS refclassid, | |
| COALESCE(to_class.relname, to_type.typname, to_proc.proname, to_ext.extname, to_con.conname) AS refobjid, | |
| to_attr.attname AS refobjsubid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { withCapacity } from 'radashi' | |
| export function keyedCapacity<TKey, TResult>(capacity: number) { | |
| const queue = withCapacity(capacity) | |
| const jobs = new Map<TKey, Promise<TResult>>() | |
| return { | |
| keys: (): IterableIterator<TKey> => jobs.keys(), | |
| get: (key: TKey): Promise<TResult> | undefined => jobs.get(key), | |
| run(key: TKey, job: () => Promise<TResult>): Promise<TResult> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Merge multiple generators into a single generator. | |
| */ | |
| function mergeGenerators<T>(generators: AsyncGenerator<T>[]): AsyncGenerator<T> | |
| /** | |
| * Merge multiple generators into a single generator. Whenever a generator | |
| * yields, the `{done, value}` object is passed to `mapResult` to transform the | |
| * value that will be yielded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * API struct for a table AM. Note this must be allocated in a | |
| * server-lifetime manner, typically as a static const struct, which then gets | |
| * returned by FormData_pg_am.amhandler. | |
| * | |
| * In most cases it's not appropriate to call the callbacks directly, use the | |
| * table_* wrapper functions instead. | |
| * | |
| * GetTableAmRoutine() asserts that required callbacks are filled in, remember | |
| * to update when adding a callback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export type Permutations<T, TInitial = T> = T extends infer TSingle | |
| ? | |
| | [TSingle] | |
| | (Permutations<Exclude<TInitial, TSingle>> extends infer TPermutation | |
| ? TPermutation extends any[] | |
| ? [T | TPermutation[number]] | |
| : never | |
| : never) | |
| : never |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { FileSystemHost, RuntimeDirEntry } from '@ts-morph/common' | |
| class MemfsFileSystemHost implements FileSystemHost { | |
| constructor(private readonly root: string) {} | |
| isCaseSensitive(): boolean { | |
| return true | |
| } | |
| readDirSync(dirPath: string): RuntimeDirEntry[] { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { vol } from 'memfs' | |
| import vfs from 'node:fs' | |
| import path from 'node:path' | |
| import { isMatch } from 'picomatch' | |
| const fixturesDir = new URL('__fixtures__', import.meta.url).pathname | |
| const nodeModulesDir = path.join(fixturesDir, 'node_modules') | |
| const fromNodeModulesDir = new URL('../../node_modules', import.meta.url) | |
| .pathname |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { RealFileSystemHost } from '@ts-morph/common' | |
| import { JumpgenFS } from 'jumpgen' | |
| export class JumpgenFileSystemHost extends RealFileSystemHost { | |
| constructor(private fs: JumpgenFS) { | |
| super() | |
| } | |
| readFile(filePath: string, encoding?: string): Promise<string> { | |
| notImplemented('readFile') | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [sqlfluff] | |
| dialect = postgres | |
| templater = raw | |
| [sqlfluff:indentation] | |
| tab_space_size = 2 | |
| [sqlfluff:rules:capitalisation.keywords] | |
| capitalisation_policy = upper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Adapted from: https://www.npmjs.com/package/to-px | |
| const PIXELS_PER_INCH = measure('in', document.body) // 96 | |
| export function toPixels(input: number | string, element: HTMLElement = document.body): number { | |
| if (typeof input === 'number') return input | |
| input = input.toLowerCase() | |
| // Support passing a unit with no amount prefix | |
| let px = unitToPixels(input, element) |