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 ^^
That's not possible. If you declare an attribute in a parent class, you can't restrict his visibility in a child class.

From the model design point of view, that doesn't make sense as well. The problem you are exposing here indicates that your class hierarchy is not well designed and you must rethink and redesign it.