I have list of weighted edges stored in database. 
How can I easily create a Graph from it (without writing it in a file and reading it)

Here the reproductible 

```
import sqlite3 
con = sqlite3.connect(":memory:")

with con:
    cur = con.cursor()    
    cur.execute("CREATE TABLE DATEN(Source TEXT, Target TEXT, Weight REAL)")
    cur.execute("INSERT INTO DATEN VALUES('X33', 'X20', 0.014)") 
    cur.execute("INSERT INTO DATEN VALUES('X32', 'X20', 0.024)") 
    cur.execute("INSERT INTO DATEN VALUES('X23', 'X20', 0.167)") 
    cur.execute("INSERT INTO DATEN VALUES('X23', 'X32', 0.015)") 
    cur.execute("INSERT INTO DATEN VALUES('X32', 'X33', 0.003)") 
    cur.execute("INSERT INTO DATEN VALUES('X23', 'X33', 0.035)")

cur.execute('SELECT * FROM DATEN')
data = cur.fetchall()

```

my attempt to create a graph fails:

```
import networkx as nx
G = nx.Graph()
for x in data:
     x1 = {'source': data[0][0], 'target': data[0][1], 'weight':  data[0][2]} 
     print x1 

     G.add_edge(x1)  # THIS IS NOT WORKING 

```

Is there an easier way to do this?