coder / code-server

VS Code in the browser
https://coder.com
MIT License
68.21k stars 5.6k forks source link

file in the database and not physical #1877

Closed GlauberF closed 4 years ago

GlauberF commented 4 years ago

I don't know if it already supports.

today my files, they are in my database and not physically my server. how can i use the editor and read these files in the database, is this possible?

wbobeirne commented 4 years ago

Hey @GlauberF, you probably would want to use some kind of database GUI for that, like https://www.pgadmin.org/ or https://omnidb.org/en/. There are also some extensions that provide database views like https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-database.

Not 100% sure your use-case, but typically full files aren't stored in databases, so I'm not sure what your workflow for reading those files would even be in a local vscode environment.

Let me know if I misunderstood your issue, but otherwise I think this is out scope for code-server.

GlauberF commented 4 years ago

@wbobeirne I think that maybe I expressed myself badly.

I have files from my cms in the database, example collection mongoDB.

{
    "name": "test",
    "ext": "json",
    "code": "string code"
}

I want to be able to connect code-server to my collection and bring this data as "files" to be modified in VSCode.

@wbobeirne if you can, reopen the issue.

wbobeirne commented 4 years ago

This sounds like extremely custom behavior for your specific project, and isn't something that local vscode supports, so I'm going to leave this closed as this is out of the scope of what code-server is trying to do.

I think you'd be best served by developing a custom extension to do this for you, or using an existing tool that's built for viewing data in mongoDB (e.g. https://www.mongodb.com/products/compass)

GlauberF commented 4 years ago

@wbobeirne maybe I am talking or asking for something that is not allowed, but I believe that many people like me can have this same need of mine. Thinking about it, I'm thinking of forking the code-server and modifying it so that it works searching the documents in the database and not physically.

In short, it will search, save, edit and delete virtual and non-physical files. This expands the options for the community.

But I have some doubts, if you can help me.

1 - Would it be more correct to fork this repository or some other that is just vscode? 2 - Would you know how to guide me, where to start after the fork?

code-asher commented 4 years ago

A custom extension is definitely the way to go for this. You can create a file system provider (https://code.visualstudio.com/api/references/vscode-api#FileSystemProvider). This will allow VS Code to use your file system provider to read and write files and the backend can be whatever you want (Mongo in your case).