Question: I need to create a variable that lists all the existing databases in my system, because I need it and I don't know how to do it. I have tried to create variables like this one:

```
DECLARE @nombreBD INT;
SET @nombreBD = (SELECT [database_id] FROM sys.databases Where name = 'model' )
SELECT @nombreBD AS Database_ID
PRINT @nombreBD
GO 

```

This variable gets me only the name I put in the "WHERE" parameter but I need to get them all.

The table sys.databases shows you all the existing databases in the system and I need to get a boolean value from it, I thought to get it from the column "database\_id" that's why I declared this variable.

Answer: 
I just came across the same use case as you and here's how I did it:

```
const Omit = <T, K extends keyof T>(Class: new () => T, keys: K[]): new () => Omit<T, typeof keys[number]> => Class;

```

Then you can use it like so :

```
class Child extends Omit(Parent, ['propertyToDelete']), {}

```

[As you can see child only has one property now](https://i.stack.imgur.com/JEGSX.png) (it also works with methods).

The package from [@nestjs/swagger](https://github.com/nestjs/swagger/tree/master/lib/type-helpers) has some nice helpers if you're dealing with a NestJS API. Their implementation is more complex so I guess they are keeping other stuff like their own property decorators (I am pretty new to Typescript so maybe I miss the point of all they are doing).

P.S: French guy tried to answer for first time with imperfect English so please be kind ^^
Here is one way to do it:

```js
class Parent {
  propertyToKeep = 'hi';
  propertyToDelete = 'bye';
  constructor() {}
}

class Child extends Parent {
  constructor() {
    super();
    delete this.propertyToDelete;
  }
}

const myObject = new Child();

console.log(myObject);
/* OUTPUT:
  {
    "propertyToKeep": "hi"
  }
*/
```