django rest make an api of database information schema -


how can make api show information schema such columns name or tables name.

for showing column name wrote code:

class columnnameview(apiview):      def get(self, request, format=none):         rawquery="select column_name information_schema.columns table_schema = 'myschema' , table_name = 'mytable'"         queryset=mytable.objects.raw(rawquery)         response_data = {}         response_list = list()         in queryset:             response_data["id"] = i.column_name             response_list.append(response_data)          return response(data=response_list) 

but got error:

raw query must include primary key 

and table name have no idea. advice thankful...


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -