| const IgniteClient = require('apache-ignite-client'); |
| const IgniteClientConfiguration = IgniteClient.IgniteClientConfiguration; |
| const CacheConfiguration = IgniteClient.CacheConfiguration; |
| |
| async function createCacheByConfiguration() { |
| const igniteClient = new IgniteClient(); |
| try { |
| await igniteClient.connect(new IgniteClientConfiguration('127.0.0.1:10800')); |
| // Create cache by name and configuration |
| const cache = await igniteClient.createCache( |
| 'myCache', |
| new CacheConfiguration().setSqlSchema('PUBLIC')); |
| } |
| catch (err) { |
| console.log(err.message); |
| } |
| finally { |
| igniteClient.disconnect(); |
| } |
| } |
| |
| createCacheByConfiguration(); |