Code:
import sqlite3
class SQLclass:
conn = sqlite3.connect('C:\ProgramData\GNS3.db')
c = conn.cursor()
# Create tables
c.execute('''create table routers(ID integer primary key, interface text, type text, clockrate text, encapsulation text, ip text, gateway text, protocol text)''')
c.execute('''create table networks(ID integer primary key, networks text)''')
c.execute('''create table switches(ID integer primary key, interface text, type text, switchport text,duplex text, speed text)''')
c.execute('''create table asas(ID integer primary key, interface text, type text, zone text,security text, ip text, gateway text)''')
c.execute('''create table devices(ID integer primary key, Name text, Type text, model text, config text)''')
c.execute('''create table vlans(ID integer primary key, number integer, name text, state text, intlist text)''') #show vlan-switch brief
c.execute('''create table computers(ID integer, type text, ip text)''')
# Load test data
c.execute('''insert into devices('1','CNC-Edge','Router','c3725', 'So much text that its hard to believe. So much text that its hard to believe.
So much text that its hard to believe. So much text that its hard to believe. So much text that its hard to believe.
So much text that its hard to believe. So much text that its hard to believe. So much text that its hard to believe.
So much text that its hard to believe. So much text that its hard to believe. So much text that its hard to believe.
So much text that its hard to believe. So much text that its hard to believe. So much text that its hard to believe.
So much text that its hard to believe. So much text that its hard to believe. So much text that its hard to believe.')''')
c.execute("""insert into routers('1','fa0/1','fast ethernet','N/A','N/A','192.168.2.2','255.255.255.252','OSPF',')""")
c.execute("""insert into computers('1', 'Server', '10.2.34.65')""")
c.execute("""insert into computers('2', 'PC', '10.109.4.65')""")
c.execute("""insert into computers('3', 'Server', '10.54.34.65')""")
# Save changes
conn.commit()
# Close cursor
c.close()