Funcjtions
- Login and Logout
- csv file upload
- select table and api
- select column to create your original api
- test sql
- create webapis
- test webapi
- delete api
- drop table
- swich database
- Login and Logout
Always, yes literaly always we start with saying ‘hi’, then ask your feeling today, I wish you are good today as well.
Then after exchanging greetings, simply asking your name, you give me your account name.
Type ‘bye’, ‘logout’ or ‘have a good day’ …. and so on, when you get out on me, and I wish you come back soon. - csv file upload
Your csv file is to be an origin of creating table. I mean I create a new table from your uploading csv file. Thus the csv file has some rules for understanding me.
i. csv file name is to be the new table name
ii. must have ‘column’ name at the head
iii. the delimiter is ‘,’
like this,file name is 'ftest.csv' ← rule(i) 'ftest' is to be the table name
You know, these data is processed like this
name,sex,age. ← rule(ii) headers are to be the column name
Jake,male,27 ← rule(iii) delimiter is ','
Secil,female,28create table ftest (name varchar, sex varchar, age integer);
make sense. Therefore the headers must apply to follow rules of sql column. I mean ‘name’ and ‘first_name’ are acceptable, but ‘first name’ or ‘first-name’ are to be concerns.
insert into ftest (name,sex,age) values('Jake','male',27);
OK, let’s up yours to me. It is very simple, you type ‘file open’,’open filebox’,’csv file’,’file upload’ and so on, I work for you as far as I can understand your order. Then you select your upload file in the opening file box and type ‘upload’,’fileup’ or simply ‘up’ and so on to exectute uploading. I execute creating and inserting as much as I can, then show you the new table and new apis that are named ‘ji*'(inserting api),’ju*'(updating api) and ‘jd*'(deleting api).
You will know I put my original column in every tables as ‘jt_id’ and ‘jetelina_delete_flg’, these are useful column and explain to you now.jt_id integer: sequence no in the table, I mean every data has unique id by this
jetelina_delete_flg boolean: managed by 'jd*' api and 'js*' api executes only true data - select table and api
After creating a new table and apis by uploading your csv file, you can touch them. Whichever you type ‘select’ and/or ‘open’ for pointing table and api, I mean ‘select ftest’,’open ftest’,’select ji*’ and ‘open ji*’ are all correct. In the case of pointing api, you can type only the number, e.g. ‘select 10’ means ‘select j*10’.
In the case of table, I show you the columns, and api, I show you its IN/OUT Json interface and internal execution sql sentence for your understanding. As far as you send me your request matched with IN Json form, I send back data with OUT Json form to you. Gottcha? - select column to create your original api
As you know, I create apis: insertion, updating and deleting, automatically by uploading your csv file. But selection apis are created by your hand.
The process is like this,i. open the table
I explain the (ii) here, the (i) is talked in 3, since (iii) is later.
ii. select columns from the display list
iii. describe its subquery if you needed
iv. test it before creating: strongry recommend
v. then create api by posting
For selecting a column, you just type ‘select’ with a column name. like ‘select name’. The pointed column moves to the bottom because it is the sign for being selected. You also can type ‘select all’ to move all columns to the bottom. You may wonder if there were similar column name in the list, for example ‘name’ and ‘nick_name’, yes ‘select name’ order execute the both column move to the bottom. Smart, does not it?
The reverse, I mean release a column in the selection, you type ‘remove’,’reject’ and ‘cancel’ is also effective, I mean ‘remove name’. Of course ‘reject all’ works as your expectation.
This is the how to select columns. - test sql
You can test your api(indeed sql sentence so far) after 4 before 6.
It is very simple, but should take care of your subquery description. I mean, the subquery has to follow some rules,i. column name should follow the displayed ones. e.g. ftest.name
These rules are quite natural for you, are not they? I expect you have a very basic skill in sql.
ii. a condition in it also should follow the column type. eg. ftest.name = 'Jake', because it is varchar
Then you type ‘test sql’,’do sql test’ and ‘check sql’ and so on to make run it on me. I return the result to you if I could get it.
The result shows your expect-able aquired data numbers and response data with OUT Json form, in fact this result display is limited only 10 data. It is enough for you so far, is not it? - create webapi
Now you are ready to create your own webapi till 5. You know, you only are able to create ‘js*'(select) webapis. Others, named ‘ji*'(inserting api),’ju*'(updating api) and ‘jd*'(deleting api) are created in 2 by me. To create ‘js*’, just type ‘create api’,’post columns’ and so on, but
CAUTION:
you should review your subquery if you set it, I mean you must set your variable parameter as a parameter.
e.g.
if you wanna select data order by ‘name’ and you may set it in the subquery in the case of test sql as
where ftest.name = ‘Jake’
and indeed you wanna select data by the name in your new webapi, you should rewrite it as
where ftest.name = ‘{name}’
The variable parameter’s conditions arei. enclose with curly brackets
There are a lot of mistake at here, watch out.
ii. set an unique name in the brackets, a same name with the column is recommended
iii. enclose with apostrophe(') if it were a string data
eg.name:string → '{name}' select ftest.jt_id,ftest.sex from ftest as ftest where ftest.name = '{name}';
age:integer → {age} select ftest.jt_id,ftest.sex from ftest as ftest where ftest.age < {age}; - test webapis
I tell you the new api number and display all webapis, then you can test each it on me, before/after you access to it from an outer of me.
At the first you select a webapi which you wanna test, ref. 3, I show you the IN/OUT and execution sql sentence, theni. type 'test api', 'api test' or 'do test' and so on
CAUTION:
ii. I ask you a value of the variable parameters if it needed
iii. you answer the value to me, then I set it into IN Json form
iv. I order you to type something after all are done
v. you type my request then I execute the webapi with your values and show the result in OUT Json form
This test is perfectly executed as same as accessing from outer of me, therefore the result data number does not be limited, I mean I return a millon data if your webapi was like that. Of course I will get tired and may will be silence, you should not make such like that. - delete api
You of course are able to delete your own webapi with typing, you may can imagine, ‘delete api js*’,’remove api js*’ and ‘reject api js*’ and more. Attantion, you only can delete ‘js*’ api by yourself, other are still under my control. These apis are able to be deleted when the table is dropped, ref. 9.
This deleting execute only once, I mean no revivlal.
Attention:
api deleting is allowed to ‘admin’ and ‘manager’, you can see your ‘roll’ by typing ‘who am i’. - drop table
Dropping table is similar with deleting api. Type ‘drop table ftest’,’table drop ftest’ like that. Anyhow, ‘drop’ is using for table, ‘delete’ is using for api. Natural, is not it?
Some apis ‘ji*’,’ju*’ and ‘jd*’ are related with the dropping table are deleted at the same time. Of course ‘js*’ apis are as well. Every apis have relation with the dropping table are cleaned up by dropping the table. Sounds nice.
Attention:
table dropping is allowed to only ‘admin’, you can see your ‘roll’ by typing ‘who am i’. - switch database
Oh yeah, finally the last function. This is one of my great function, I can manage multi database at once, and you can switch between them more than easier riding a scooter.
At the first time you connect to a database what you wanna use, I try to connect to it and show its icon with hilighting if the trying suceeded, but if it failed, I show you the connection parameters, then set or change them and call me again.
In the case of you have already suceeded to a database that you wanna use, the icon is already displayed, then simply ask me ‘change database’,’change data base’ and so on, then I ask you ‘which database?’ then you type database name what you wanna use. Or more directly ‘wanna use mysql’ such like that. The switched database is hilighten on the screen, watch out.