go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  Create Tables/Families
 
Subject: Create Tables/Families
Author: EricJ
In response to: Create Keyspace
Posted on: 11/13/2016 10:57:08 PM

	// column family: songs
	session.execute("CREATE TABLE IF NOT EXISTS simplex.songs ("
			+ "id uuid PRIMARY KEY, " 
                        + "title text, " 
                        + "album text,"
			+ "artist text, " 
                        + "tags set<text>, "
                        + "data blob" + ");"
        );
		
	// column family: playlists
	session.execute("CREATE TABLE IF NOT EXISTS simplex.playlists ("
			+ "id uuid, " 
                        + "title text, " 
                        + "album text, " 
                        + "artist text,"
			+ "song_id uuid, " 
                        + "PRIMARY KEY (id, title, album, artist)"
			+ ");"
        );



 

> On 11/13/2016 10:33:29 PM EricJ wrote:

	// keyspace: simplex
	session.execute(
               "CREATE KEYSPACE IF NOT EXISTS simplex " +
               "WITH replication " +
	       "= {'class':'SimpleStrategy', 'replication_factor':3};"  // redundancy : 3
        );






References:

 


 
Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
 
Get your own forum today. It's easy and free.