On Steemit, you may mute the people you do not like,and can check who are muted by you at the setting field. For example, I muted three users for test purpose 😀
But,I can not find out where to check that who muted me, This may not make sense, but it is interesting!😀 So I wrote a script to do this,very simple, but easy to use. Let me introduce it to you.
其实这不是大问题,因为数据库信息是可以自行获取的,查询语句如下: SELECT Name FROM Master..SysDatabases ORDER BY Name
示例代码
1 2 3 4 5 6
import pymssql conn = pymssql.connect(host ="sql.steemsql.com",user="steemit",password="steemit", charset="utf8") cur = conn.cursor() cur.execute("SELECT Name FROM Master..SysDatabases ORDER BY Name") rows = cur.fetchall() for row in rows: print(row[0])
查询语句如下: SELECT Name FROM DatabaseName..SysColumns WHERE id=Object_Id('TableName')
来试试Comments表 cur.execute("SELECT Name FROM DBSteem..SysColumns WHERE id=Object_Id('Comments')") (查询当前数据库下的表可以省略路径DBSteem..)
结果如下:
abs_rshares active active_votes allow_curation_rewards allow_replies allow_votes author author_reputation author_rewards beneficiaries body body_language body_length cashout_time category children children_abs_rshares created curator_payout_value depth dirty ID json_metadata last_payout last_update max_accepted_payout max_cashout_time mode net_rshares net_votes parent_author parent_permlink pending_payout_value percent_steem_dollars permlink promoted reblogged_by replies reward_weight root_comment root_title title total_payout_value total_pending_payout_value total_vote_weight TS url vote_rshares
查询数据表中的字段详细信息 / Query fields details in a data table
有了上述基础,我们可以进一步查询字段的详细信息 以TxComments表为例: cur.execute("SELECT SysColumns.Name,SysTypes.Name,SysColumns.IsNullable,SysColumns.Length FROM SysColumns, SysTypes WHERE SysColumns.XUserType = SysTypes.XUserType AND SysColumns.Id = object_id('TxComments')")
结果如下:
1 2 3 4 5 6 7 8 9 10
ID int 0 4 tx_id int 0 4 author varchar 0 50 permlink varchar 0 512 parent_author varchar 0 50 parent_permlink varchar 0 512 title nvarchar 0 -1 body nvarchar 0 -1 json_metadata varchar 0 -1 timestamp datetime 0 8
结论 / Conclusions
我们探讨了如何通过SQL语句
查询数据库名 / Query all database names
查询数据库中所有数据表 / Query all data tables in the database
查询数据表中的字段 / Query fields in a data table
查询数据表中的字段详细信息 / Query fields details in a data table