How to fast add this structure to mysql table (with same col. name)? There is around 15,000 similar records, twitch here can be not set with some records all other are in all records. I work with python 2.7.9 and MySQL 5.5+
print(data)
>>>[
{
u'account': {
u'challenges': {u'total': 0
},
u'twitch': {u'name': u'lgt_justice'
},
u'name': u'Dawwwis'
},
u'character': {
u'class': u'Witch',
u'experience': 4250334444,
u'level': 100,
u'name': u'Em_Jake'
},
u'dead': False,
u'online': False,
u'rank': 1,
},
... # around 15,000 entries
]
MySQL table:
CREATE TABLE `acc` (
`challenges` TINYINT UNSIGNED NOT NULL ,
`twitch` VARCHAR(30) NULL ,
`accName` VARCHAR(30) NOT NULL ,
`charName` VARCHAR(30) NOT NULL ,
`class` VARCHAR NOT NULL ,
`exp` INT UNSIGNED NOT NULL ,
`lvl` TINYINT UNSIGNED NOT NULL ,
`dead` BOOLEAN NOT NULL ,
`online` BOOLEAN NOT NULL ,
`rank` TINYINT UNSIGNED NOT NULL );
challenges
-> account.challenges.total
twitch
-> account.twitch.name (this can be not set)
accName
-> account.name
charName
-> character.name
class
-> character.class
exp
-> character.experience
lvl
-> character.lvl
dead
-> dead
online
-> online
rank
-> rank