public Encoder tableEncoder(String sql, String name) throws SQLiteException {

		/*
		 * Pack peers table Table ::= SEQUENCE { name TableName, fields SEQUENCE
		 * OF FieldName, fieldTypes SEQUENCE OF FieldType, rows SEQUENCE OF
		 * SEQUENCE OF NULLOCTETSTRING }
		 */
		Database db = manager.getDB();

		Table peer=db.getTable(sql);
		
		Encoder peerTableEncoder = new Encoder(); // Table Encoder <-------
		
		peerTableEncoder.initSequence();
		peerTableEncoder.addToSequence(new Encoder(name));

		// Add all columns objects to Encoder
		Encoder peerColumnNamesEncoder = new Encoder();
		peerColumnNamesEncoder.initSequence();
		String[] peerColumnNames = peer.getColumnsNames();
		for (int i = 0; i < peerColumnNames.length; i++) {

			peerColumnNamesEncoder
					.addToSequence(new Encoder(peerColumnNames[i]));

		}

		peerTableEncoder.addToSequence(peerColumnNamesEncoder);

		Encoder peerColumnTypesEncoder = new Encoder();
		peerColumnTypesEncoder.initSequence();

		// Set all fields as texts... because they are not used on client side
		for (int i = 0; i < peerColumnNames.length; i++) {

			peerColumnTypesEncoder.addToSequence(new Encoder("TEXT"));

		}

		peerTableEncoder.addToSequence(peerColumnTypesEncoder);
		
		// Now all rowss
		Encoder rowsEncoder = new Encoder();
		rowsEncoder.initSequence();

		// For each row add elements to Sequence, so sequence of sequences will
		// be constructed
		if (LOG)
		System.out.println("Table "+name+" fields results count: "+peer.getColumn(0).size());
		for (int i = 0; i < peer.getColumn(0).size(); i++) {
			Encoder rowEncoder = new Encoder();
			rowEncoder.initSequence();

			for (int j = 0; j < peerColumnNames.length; j++) {
				Object var=peer.getColumn(j)
						.getObjectAtRow(i);
				
				if (var!=null){
				
				rowEncoder.addToSequence(new Encoder(var.toString()));
				} else {
				
				rowEncoder.addToSequence(new Encoder(" "));
				}
			}

			rowsEncoder.addToSequence(rowEncoder);
		}

		peerTableEncoder.addToSequence(rowsEncoder);

		return peerTableEncoder;
	}