Comments (3)
Nevermind. I had wreong env variable name
from redis.
@oplik0 Thanks for your suggestion! I think having support for the redis url is good 😃
From my understanding, they require a bit more complicated logic than simple connect, as they actually should be equivalent to connecting and then issuing AUTH and/or SELECT commands if password and/or database number were specified.
The connect()
function automatically executes AUTH
and/or SELECT
commands if password
and/or db
options were specified in RedisConnectOptions. So I think it would be good to add a simple utility to parse the redis url as follows:
parseURL(url: string): RedisConnectOptions
import { connect, parseURL } from "https://deno.land/x/redis/mod.ts";
const options = parseURL("redis://foo:bar@localhost:6379/1");
const redis = await connect(options);
console.log(await redis.get("key"));
from redis.
This is broken
$ ./bin/start.sh
PORT: 8061
Download ⠼ https://deno.land/x/[email protected]/buf_reader.ts Warning Implicitly using latest version (v0.27.4) for https://deno.land/x/redis/mod.ts
error: Uncaught TypeError: Invalid URL
} = new URL(url);
^
at getSerialization (deno:ext/url/00_url.js:76:13)
at opUrlParse (deno:ext/url/00_url.js:67:12)
at new URL (deno:ext/url/00_url.js:358:29)
at parseURL (https://deno.land/x/[email protected]/redis.ts:2408:7)
at file:///home/ettinger/www/grazily.com/grazily-api/index.ts:25:19
import { Application, config, oakCors, Mongo, redis, redisParseURL } from "./src/deps.ts";
const redisOpts = redisParseURL(env.redis);
const cache = await redis(redisOpts);
from redis.
Related Issues (20)
- Suggestion: Use docker-based redis for tests
- BREAKING: Rename `withScore` to `withScores`
- Re-enable `deno task make_mod` in CI
- BulkNil and execArrayReply breaking xread
- PubSub with binary messages HOT 1
- [feat] keepalive feature
- [feat] automatically reconnect when interrupted
- Bug: xrange failed to parse empty string
- deps: import `cluster-key-slot` and `lodash-es` from esm.sh
- Support for RedisJson - JSON.GET
- Support AbortController in a client HOT 1
- Watch vs tx HOT 1
- Subscribe / psubscribe hangs after calling sub.receive() HOT 1
- `Redis.scan` cursor parameter requires a number
- sendCommand api inconsistency HOT 1
- Property 'set' does not exist on type 'Redis'.deno-ts(2339) HOT 5
- Parallel Request Issue HOT 1
- Subscribe, unsubscribe, resubscribe HOT 4
- feat: Auto-pipelining
- feat: Connection pooling
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis.