create entities and attributes programmatically in outsystems 11

I would like full CRUD capabilities to create and populate entities in Outsystems Cloud DB programmatically through an external service or operation such as an api call and or odbc and sql.  


Is there a way to execute this?  Are there any examples?  

Hello Jeremy,

You can certainly create REST APIs in OutSystems that simply wrap the CRUD operations of your entities.  If you want to execute SQL against them though, you would need an extension (or possibly the Advance Query Forge component).

Is this what you are asking to accomplish?

Craig St.Jean wrote:

Hello Jeremy,

You can certainly create REST APIs in OutSystems that simply wrap the CRUD operations of your entities.  If you want to execute SQL against them though, you would need an extension (or possibly the Advance Query Forge component).

Is this what you are asking to accomplish?

 Thanks Craig for the reply.  For the API the challenge is you cannot create the tables themselves (e.g. create an operational table called "customer", only write to them after they have been created by way of the IDE.  I will review the Advance Query component.  

 

Hi Jeremy,

You are talking about CRUD in your post, but what you really are after is the ability to execute DDL on the database.  Hence the confusion.

You are specifically asking about outsystems cloud, meaning you understand you could just go through regular database tools in an on premises database and was wondering how to do it in a cloud setup ??

So can you tell a bit more about your intentions.  Suppose you can gain access to that database and add some tables, how does that relate to your low code applications.  It's not because you have a table in a database that you have an entity in an application.  If you have the need to create tables outside of the platform, you can do that in any database, how do you think about tying that in with your application ?

Dorine

Hi,

you can check this article: OutSystems CRUD Wrapper Basics

Cheers

Miguel Verdasca wrote:

Hi,

you can check this article: OutSystems CRUD Wrapper Basics

Cheers

 

 Miguel,

He's not after crud wrappers, he's looking for a way to create entities / tables outside of service studio. On the fly, for some reason

Hello Jeremy,

It might technically be possible (I haven't tried), but you would have to consider:

  • Service Studio will not allow this, so you would have to write an extension
  • What are the security implications of doing this?
    • Do NOT underestimate the importance of this question
  • Are you familiar enough with the metadata model in the OutSystems system tables?
    • These would have to be updated and maintained.  Also, since you would be working with the system in an unsupported manner, there is the potential that you could break the platform, or an update could break your process
  • What would be the value in this?  To query the entities you would either need to use an Aggregate in Service Studio, so you are already making changes this way, or you would have to use an extension to query the tables

That said, maybe it would be better to talk about what you are trying to actually accomplish from a user perspective.  If you need dynamic datastructures, you could consider using a document database (Apache CouchDB, MongoDB, AWS DocumentDB) on an external server, or you could consider a table structure like this:

With the above structure, you can dynamically create "entities", but they would be fit into a structure that wouldn't require such difficulty as actually creating tables dynamically.