Question: How do I add format function, to get 'S01E02' ?

The following executes S8E72.

```
select 
    title, concat('S', season, 'E', episode) as 'episode' 
from GameOfThrones

```

I've tried with

```
select FORMAT(episode, '00')

```

Answer: 
The type doesn't exist at run time.

However, (leaning heavily on [this beautiful answer](https://github.com/microsoft/TypeScript/issues/13298#issuecomment-692864087), which will require TS4.x because of its use of recursive conditional types), you can create a tuple type that enforces a tuple with the required names.

So:

```
type TupleUnion<U extends string, R extends string[] = []> = {
    [S in U]: Exclude<U, S> extends never 
                ? [...R, S] 
                : TupleUnion<Exclude<U, S>, [...R, S]>;
}[U] & string[];

export type UsersSchema = {
  id: number;
  firstName: string;
  lastName: string;
  email: string;
};

const allKeysOfUsersSchema: TupleUnion<keyof UsersSchema> = 
    ["id", "firstName", "lastName", "email"]; //OK

const wrongKeysOfUsersSchema: TupleUnion<keyof UsersSchema> = 
    ["monkey", "firstName", "lastName", "email"]; //error

const missingKeysOfUsersSchema: TupleUnion<keyof UsersSchema> = 
    ["id", "firstName", "lastName"]; //error

const tooManyKeysOfUsersSchema: TupleUnion<keyof UsersSchema> = 
    ["id", "firstName", "lastName", "email", "cat"]; //error

```

OK... so you'll have to maintain this separate tuple, manually, but at least if things change, the compiler will push you into remedial action, so type-safety is maintained.

[Playground link](https://www.typescriptlang.org/play?ts=4.2.3#code/C4TwDgpgBAKgrmANhAqgOwJYHs0B4VQQAewEaAJgM5SXABOGaA5gDRQBKhJZVN9jTANoBdKAF4oIgHzioAbwBQASEEBlKIygphALigBRIgGNEcchHxtVM4qQrU0EAG4Q6UAPySAdD-ZXRevBIqJg4uIYmZhYoVlJsgj5eflCqwlIA3AoAvoLaUABkfAzMIpkKCsRgWHTAUKCQWpSulKpGABYQALYAhrKKUBrkemhwnQBGrpkDAGYYdLQAct2dEHq0xUxTUIjdi8urRQJbXd0YiGv8zJlZZUY4tFDdiIgA0hAglADy0yhN860dHqBBDIdDYPAAa3eWGmjWaAJOMgkggARBhyCi2CjZvNgEsVpioCidnsCViTmcUcJbvdagB3Og4JhvD7fX7w9onYHBMFhKEgGFw-6cnpIyQozo4fmE7FzUkQGUkvH7GUUxBUmloB6dDCUSgCFlfH5-Foi7rc0GhSHQ2Hs4WA7pi1HomU4%20WK3bKgnU8p3LW1YBYLAAWW6aBAhrZJoRQNgIJC4Nw-MFdtNDqdaIxWLdXoVWKV%20LzRLVMqM3WAGvKQA)
You can use `keyof` type operator.

```js
export type UsersSchema = {
  id: number;
  firstName: string;
  lastName: string;
  email: string;
};

type Keys = keyof UsersSchema // "id" | "firstName" | "lastName" | "email"

```